From f6acae9f3d92a324c80ec07a94515e13692a2843 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 24 Oct 2011 17:17:39 +0800 Subject: [PATCH] Don't init the Big Clutter Lock on Win32 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 assumtopns-http://lists-archives.org/gtk/12724-compiling-a-gtk-application-on-windows.html --- clutter/clutter-main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 7d4d8159a..80d7bf88c 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -215,11 +215,13 @@ clutter_threads_init_default (void) { g_mutex_init (&clutter_threads_mutex); +#ifndef HAVE_CLUTTER_WIN32 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 } #define ENVIRONMENT_GROUP "Environment"