From 7c6038d77b0d0b3323867f8a881d72ca37bb8b7c Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 25 Oct 2011 00:13:53 +0800 Subject: [PATCH] Bug 662071-[Win32]-Don't init the Big Clutter Lock Since the Windows GUI system is assuming multithreadedness, initializing locks after entering the GUI portion on Windows is likely to cause problems[1][2], which results many Clutter programs to crash due to releasing resources that they did not own. [1]: Multi-threaded use of GTK+ on Win32 in README.win32 of GTK+ source package [2]: Explanation of Windows GUI system regarding its multithreadness assumptions- http://mail.gnome.org/archives/gtk-list/2011-June/msg00005.html --- clutter/clutter-main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 7d4d815..ff34bb0 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -215,11 +215,17 @@ clutter_threads_init_default (void) { g_mutex_init (&clutter_threads_mutex); +#ifndef CLUTTER_WINDOWING_WIN32 + /* we don't need nor want locking functions on Windows.here + * as Windows GUI system assumes multithreadedness + * see bug: https://bugzilla.gnome.org/show_bug.cgi?id=662071 + */ if (clutter_threads_lock == NULL) clutter_threads_lock = clutter_threads_impl_lock; if (clutter_threads_unlock == NULL) clutter_threads_unlock = clutter_threads_impl_unlock; +#endif /* CLUTTER_WINDOWING_WIN32 */ } #define ENVIRONMENT_GROUP "Environment" -- 2.7.4