From: Dan Winship Date: Sat, 6 Nov 2010 13:35:25 +0000 (-0400) Subject: gmain: move finalization of GSource outside of context lock X-Git-Tag: 2.27.4~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b358202856682e5cdefb0b4b8aaed3a45d9a85fa;p=platform%2Fupstream%2Fglib.git gmain: move finalization of GSource outside of context lock This avoids ugly deadlock situations such as in https://bugzilla.gnome.org/show_bug.cgi?id=586432 https://bugzilla.gnome.org/show_bug.cgi?id=626702 https://bugzilla.gnome.org/show_bug.cgi?id=634239 --- diff --git a/glib/gmain.c b/glib/gmain.c index b182c66..301adb0 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -1520,7 +1520,13 @@ g_source_unref_internal (GSource *source, g_source_list_remove (source, context); if (source->source_funcs->finalize) - source->source_funcs->finalize (source); + { + if (context) + UNLOCK_CONTEXT (context); + source->source_funcs->finalize (source); + if (context) + LOCK_CONTEXT (context); + } g_free (source->name); source->name = NULL;