Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
GTypeModule derived class unref does not unload plugin
Browse files Browse the repository at this point in the history
Correctly unref the pclass. Patch by Chris Wilson and Tim Janik.

https://bugzilla.gnome.org/show_bug.cgi?id=350200
  • Loading branch information
bratsche authored and Matthias Clasen committed Oct 25, 2009
1 parent cf62293 commit 7acedea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gobject/gtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7acedea

Please sign in to comment.