summaryrefslogtreecommitdiff
path: root/pango/pango-context.c
diff options
context:
space:
mode:
authorAlessandro Pignotti <a.pignotti@sssup.it>2011-05-25 16:04:22 +0200
committerBehdad Esfahbod <behdad@behdad.org>2012-08-27 23:21:52 -0400
commita4eeee8e222db740ca83d29217d707db1160ada8 (patch)
tree7a37f75aba1a94e29b4261c722b860acae1f8d31 /pango/pango-context.c
parentba9119bcef52232c38329a5be91d9b5d158f2bc4 (diff)
downloadpango-a4eeee8e222db740ca83d29217d707db1160ada8.tar.gz
Make static data thread safe in pango-context.c
Diffstat (limited to 'pango/pango-context.c')
-rw-r--r--pango/pango-context.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pango/pango-context.c b/pango/pango-context.c
index a909cd05..cdb6a53a 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -1368,8 +1368,8 @@ string_from_script (PangoScript script)
{
static GEnumClass *class = NULL;
GEnumValue *value;
- if (!class)
- class = g_type_class_ref (PANGO_TYPE_SCRIPT);
+ if (g_once_init_enter ((gsize*)&class))
+ g_once_init_leave((gsize*)&class, (gsize)g_type_class_ref (PANGO_TYPE_SCRIPT));
value = g_enum_get_value (class, script);
if (!value)