summaryrefslogtreecommitdiff
path: root/gobject/gtype.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2006-12-16 04:28:43 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-12-16 04:28:43 +0000
commit0eb82133c519e7cc08ee6de2daef449581e4f9d6 (patch)
tree257eea0b43767e9e132118c8c79be0283c01d683 /gobject/gtype.c
parent4efa98d75b3cabef27c04b6554c8f49d34331a92 (diff)
downloadglib-0eb82133c519e7cc08ee6de2daef449581e4f9d6.tar.gz
Fri Dec 15 2006 Matthias Clasen <mclasen@redhat.com>
* gtype.c (instance_real_class_get): Dereference the pointer before dropping the lock. (#378078, Jonathan Matthew)
Diffstat (limited to 'gobject/gtype.c')
-rw-r--r--gobject/gtype.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 12ce66fe8..44620db6c 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -1511,11 +1511,13 @@ static inline GTypeClass*
instance_real_class_get (gpointer instance)
{
InstanceRealClass key, *node;
+ GTypeClass *class;
key.instance = instance;
G_LOCK (instance_real_class);
node = instance_real_class_bsa ? g_bsearch_array_lookup (instance_real_class_bsa, &instance_real_class_bconfig, &key) : NULL;
+ class = node ? node->class : NULL;
G_UNLOCK (instance_real_class);
- return node ? node->class : NULL;
+ return class;
}
GTypeInstance*