From: Christian Persch Date: Wed, 8 Oct 2008 20:54:39 +0000 (+0000) Subject: Bug 555313 – GFileAttribute boxed type get_type function should use X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=5d31f41df465e07f22bcbe26cd919513af65849c;p=dana%2Fcg-glib.git Bug 555313 – GFileAttribute boxed type get_type function should use usual get_type pattern svn path=/trunk/; revision=7580 --- diff --git a/ChangeLog b/ChangeLog index f4fc6ab7..ff93dc8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-10-08 Christian Persch + + Bug 555313 – GFileAttribute boxed type get_type function should + use usual get_type pattern + + * gio/gfileattribute.c (g_file_attribute_info_list_get_type): Use + g_once_init_enter/leave. + 2008-10-08 Christian Persch Bug 555314 – mem leak in gmarkup diff --git a/gio/gfileattribute.c b/gio/gfileattribute.c index bea20daa..76bdf611 100644 --- a/gio/gfileattribute.c +++ b/gio/gfileattribute.c @@ -329,13 +329,19 @@ _g_file_attribute_value_dup (const GFileAttributeValue *other) GType g_file_attribute_info_list_get_type (void) { - static GType type_id = 0; + static volatile gsize g_define_type_id__volatile = 0; - if (!type_id) - type_id = g_boxed_type_register_static (g_intern_static_string ("GFileAttributeInfoList"), - (GBoxedCopyFunc) g_file_attribute_info_list_dup, - (GBoxedFreeFunc) g_file_attribute_info_list_unref); - return type_id; + if (g_once_init_enter (&g_define_type_id__volatile)) + { + GType g_define_type_id = + g_boxed_type_register_static (I_("GFileAttributeInfoList"), + (GBoxedCopyFunc) g_file_attribute_info_list_dup, + (GBoxedFreeFunc) g_file_attribute_info_list_unref); + + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; } static gboolean