From 5d31f41df465e07f22bcbe26cd919513af65849c Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 8 Oct 2008 20:54:39 +0000 Subject: [PATCH] =?utf8?q?Bug=20555313=20=E2=80=93=20GFileAttribute=20boxe?= =?utf8?q?d=20type=20get=5Ftype=20function=20should=20use=20usual=20get=5F?= =?utf8?q?type=20pattern?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=7580 --- ChangeLog | 8 ++++++++ gio/gfileattribute.c | 18 ++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4fc6ab..ff93dc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 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 * glib/gmarkup.c: (g_markup_parse_context_parse): Plug a mem leak. diff --git a/gio/gfileattribute.c b/gio/gfileattribute.c index bea20da..76bdf61 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 -- 2.7.4