view src/cairo-2-static-init.patch @ 5499:be0a7ce498e6

Update mesa to version 20.0.8 (bug #58689). * src/mesa.mk: Update version and checksum. Add build-meson to dependecies. Update build rule to use meson and ninja as the build tools. * src/mesa-1-meson.patch: Add new patch. * src/mesa-1-fixes.patch: Remove old patch for the scons rule that is no longer needed. * dist-files.mk: Update file list. * src/build-mako.mk: Depend on and use python3. * src/build-markupsafe.mk: Depend on and use python3.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 05 Jul 2020 20:58:57 +0200
parents 6aaa1723e277
children
line wrap: on
line source

This file is part of MXE.
See index.html for further information.

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..31d854d 100644
--- 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)
 {
     cairo_hash_table_t *hash_table;

+#ifndef DLL_EXPORT 
+    CAIRO_MUTEX_INITIALIZE ();
+#endif
+
     /* 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 +1929,10 @@ _cairo_win32_font_face_hash_table_destroy (void)
 static cairo_hash_table_t *
 _cairo_win32_font_face_hash_table_lock (void)
 {
+#ifndef DLL_EXPORT
+    CAIRO_MUTEX_INITIALIZE ();
+#endif
+
     CAIRO_MUTEX_LOCK (_cairo_win32_font_face_mutex);
 
     if (unlikely (cairo_win32_font_face_hash_table == NULL))