From fa7eb4e5a8195fc48552791373ea1f8b83822488 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 22 Aug 2007 10:12:15 +0000 Subject: [PATCH] Remove the threads locking in the dispatchers destruction notification The GLib main loop allows destroying sources while still in the dispatcher function, so whether the Clutter threading lock is being held or not is actually unpredictable by the library. This might be fixed in GLib, so we just do what GTK+ does for the time being and wait. See bug: http://bugzilla.gnome.org/show_bug.cgi?id=459555 --- clutter/clutter-main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index b56fe4739..3bddfab85 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -549,13 +549,15 @@ clutter_threads_dispatch_free (gpointer data) { ClutterThreadsDispatch *dispatch = data; - clutter_threads_enter (); - + /* XXX - we cannot hold the thread lock here because the main loop + * might destroy a source while still in the dispatcher function; so + * knowing whether the lock is being held or not is not known a priori. + * + * see bug: http://bugzilla.gnome.org/show_bug.cgi?id=459555 + */ if (dispatch->notify) dispatch->notify (dispatch->data); - clutter_threads_leave (); - g_slice_free (ClutterThreadsDispatch, dispatch); }