diff options
author | Cody Russell <bratsche@gnome.org> | 2009-10-14 21:24:30 -0500 |
---|---|---|
committer | Cody Russell <bratsche@gnome.org> | 2009-10-14 21:24:30 -0500 |
commit | 8eebc189440693922e23298a761189cfbe71f796 (patch) | |
tree | b3b3d60aa4c916016802c7d10d4aaab05d65dfab /gobject | |
parent | e95a3b0576fc9426441956e4053791e197d4f421 (diff) |
GTypeModule derived class unref does not unload plugin
Correctly unref the pclass. Patch by Chris Wilson and Tim Janik.
https://bugzilla.gnome.org/show_bug.cgi?id=350200
Diffstat (limited to 'gobject')
-rw-r--r-- | gobject/gtype.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gobject/gtype.c b/gobject/gtype.c index c6dff7f87..d5822422e 100644 --- a/gobject/gtype.c +++ b/gobject/gtype.c @@ -2652,13 +2652,15 @@ g_type_class_ref (GType type) */ if (!node->data->class.class) /* class uninitialized */ { - /* acquire reference on parent class */ + /* we need an initialized parent class for initializing derived classes */ GTypeClass *pclass = ptype ? g_type_class_ref (ptype) : NULL; G_WRITE_LOCK (&type_rw_lock); if (node->data->class.class) /* class was initialized during parent class initialization? */ INVALID_RECURSION ("g_type_plugin_*", node->plugin, NODE_NAME (node)); type_class_init_Wm (node, pclass); G_WRITE_UNLOCK (&type_rw_lock); + if (pclass) + g_type_class_unref (pclass); } g_static_rec_mutex_unlock (&class_init_rec_mutex); |