summaryrefslogtreecommitdiff
path: root/gobject
diff options
context:
space:
mode:
author4 <timj@birnet.org>2004-10-06 00:15:07 +0000
committerTim Janik <timj@src.gnome.org>2004-10-06 00:15:07 +0000
commit565d9253e722d7743b07c0006c8c31adc1e49319 (patch)
tree60ef557473bbeb027a611029288d2a6fe85d632a /gobject
parent9af2838a91fdbb84549622652d25ec557278c6c5 (diff)
applied patch from Jean-Yves Lefort <jylefort@brutele.be> to not access
Wed Oct 6 02:12:44 2004 <timj@birnet.org> * gtype.c (g_type_instance_get_private): applied patch from Jean-Yves Lefort <jylefort@brutele.be> to not access the instance_real_class_bsa pointer without holding the instance_real_class lock.
Diffstat (limited to 'gobject')
-rw-r--r--gobject/ChangeLog6
-rw-r--r--gobject/gtype.c11
2 files changed, 9 insertions, 8 deletions
diff --git a/gobject/ChangeLog b/gobject/ChangeLog
index 36d154875..5b569fda4 100644
--- a/gobject/ChangeLog
+++ b/gobject/ChangeLog
@@ -1,3 +1,9 @@
+Wed Oct 6 02:12:44 2004 <timj@birnet.org>
+
+ * gtype.c (g_type_instance_get_private): applied patch from Jean-Yves
+ Lefort <jylefort@brutele.be> to not access the instance_real_class_bsa
+ pointer without holding the instance_real_class lock.
+
2004-10-04 Matthias Clasen <mclasen@redhat.com>
* gsignal.c (g_signal_add_emission_hook): Improve the warning
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 6aaf87cc9..cea390087 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -1515,7 +1515,7 @@ instance_real_class_get (gpointer instance)
InstanceRealClass key, *node;
key.instance = instance;
G_LOCK (instance_real_class);
- node = g_bsearch_array_lookup (instance_real_class_bsa, &instance_real_class_bconfig, &key);
+ node = instance_real_class_bsa ? g_bsearch_array_lookup (instance_real_class_bsa, &instance_real_class_bconfig, &key) : NULL;
G_UNLOCK (instance_real_class);
return node ? node->class : NULL;
}
@@ -3535,13 +3535,8 @@ g_type_instance_get_private (GTypeInstance *instance,
/* while instances are initialized, their class pointers change,
* so figure the instances real class first
*/
- if (instance_real_class_bsa)
- {
- class = instance_real_class_get (instance);
- if (!class)
- class = instance->g_class;
- }
- else
+ class = instance_real_class_get (instance);
+ if (!class)
class = instance->g_class;
instance_node = lookup_type_node_I (class->g_type);