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
This commit is contained in:
Chun-wei Fan 2011-10-24 17:17:39 +08:00
parent 0bc1ac2312
commit f6acae9f3d

View File

@ -215,11 +215,13 @@ clutter_threads_init_default (void)
{ {
g_mutex_init (&clutter_threads_mutex); g_mutex_init (&clutter_threads_mutex);
#ifndef HAVE_CLUTTER_WIN32
if (clutter_threads_lock == NULL) if (clutter_threads_lock == NULL)
clutter_threads_lock = clutter_threads_impl_lock; clutter_threads_lock = clutter_threads_impl_lock;
if (clutter_threads_unlock == NULL) if (clutter_threads_unlock == NULL)
clutter_threads_unlock = clutter_threads_impl_unlock; clutter_threads_unlock = clutter_threads_impl_unlock;
#endif
} }
#define ENVIRONMENT_GROUP "Environment" #define ENVIRONMENT_GROUP "Environment"