mxe/src/cairo-2-static-init.patch

31 lines
1.0 KiB
Diff
Raw Permalink Normal View History

This file is part of MXE. See LICENSE.md for licensing information.
2012-06-04 16:56:56 +01:00
When DllMain is not being run, we need to initialize the font face mutex before using it.
diff --git a/src/win32/cairo-win32-font.c b/src/win32/cairo-win32-font.c
index a65d81b..d6950a1 100644
2012-06-04 16:56:56 +01:00
--- a/src/win32/cairo-win32-font.c
+++ b/src/win32/cairo-win32-font.c
@@ -1912,6 +1912,10 @@ _cairo_win32_font_face_hash_table_destroy (void)
2012-06-04 16:56:56 +01:00
{
cairo_hash_table_t *hash_table;
+#ifdef CAIRO_WIN32_STATIC_BUILD
2012-06-04 16:56:56 +01:00
+ CAIRO_MUTEX_INITIALIZE ();
+#endif
2012-06-04 16:56:56 +01:00
+
/* We manually acquire the lock rather than calling
* _cairo_win32_font_face_hash_table_lock simply to avoid creating
* the table only to destroy it again. */
@@ -1927,6 +1931,10 @@ _cairo_win32_font_face_hash_table_destroy (void)
2012-06-04 16:56:56 +01:00
static cairo_hash_table_t *
_cairo_win32_font_face_hash_table_lock (void)
{
+#ifdef CAIRO_WIN32_STATIC_BUILD
2012-06-04 16:56:56 +01:00
+ CAIRO_MUTEX_INITIALIZE ();
+#endif
2012-06-04 16:56:56 +01:00
+
CAIRO_MUTEX_LOCK (_cairo_win32_font_face_mutex);
if (unlikely (cairo_win32_font_face_hash_table == NULL))