Commit acb7f644 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

543504 – crash in Epiphany Web Browser: Opening local file

2008-07-19  Matthias Clasen  <mclasen@redhat.com>

        543504 – crash in Epiphany Web Browser: Opening local file

        * gappinfo.c:
        * gasyncresult.c:
        * gdesktopappinfo.c:
        * gdrive.c:
        * gfile.c:
        * gicon.c:
        * gloadableicon.c:
        * gmount.c:
        * gseekable.c:
        * gvolume.c: Register types thread-safely.
        Patch by Christian Persch


svn path=/trunk/; revision=7208
parent cb3b591a
2008-07-19 Matthias Clasen <mclasen@redhat.com>
543504 – crash in Epiphany Web Browser: Opening local file
* gappinfo.c:
* gasyncresult.c:
* gdesktopappinfo.c:
* gdrive.c:
* gfile.c:
* gicon.c:
* gloadableicon.c:
* gmount.c:
* gseekable.c:
* gvolume.c: Register types thread-safely.
Patch by Christian Persch
2008-07-18 Matthias Clasen <mclasen@redhat.com>
* gcontenttype.c: Remove debug spew
......
......@@ -46,11 +46,11 @@ static void g_app_info_class_init (gpointer g_class,
GType
g_app_info_get_type (void)
{
static GType app_info_type = 0;
static volatile gsize g_define_type_id__volatile = 0;
if (! app_info_type)
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo app_info_info =
const GTypeInfo app_info_info =
{
sizeof (GAppInfoIface), /* class_size */
g_app_info_base_init, /* base_init */
......@@ -62,15 +62,16 @@ g_app_info_get_type (void)
0, /* n_preallocs */
NULL
};
app_info_type =
GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GAppInfo"),
&app_info_info, 0);
g_type_interface_add_prerequisite (app_info_type, G_TYPE_OBJECT);
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return app_info_type;
return g_define_type_id__volatile;
}
static void
......
......@@ -115,11 +115,11 @@ static void g_async_result_class_init (gpointer g_class,
GType
g_async_result_get_type (void)
{
static GType async_result_type = 0;
static volatile gsize g_define_type_id__volatile = 0;
if (! async_result_type)
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo async_result_info =
const GTypeInfo async_result_info =
{
sizeof (GAsyncResultIface), /* class_size */
g_async_result_base_init, /* base_init */
......@@ -131,15 +131,16 @@ g_async_result_get_type (void)
0, /* n_preallocs */
NULL
};
async_result_type =
GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GAsyncResult"),
&async_result_info, 0);
g_type_interface_add_prerequisite (async_result_type, G_TYPE_OBJECT);
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return async_result_type;
return g_define_type_id__volatile;
}
static void
......
......@@ -2502,11 +2502,11 @@ static void g_desktop_app_info_lookup_class_init (gpointer g_class,
GType
g_desktop_app_info_lookup_get_type (void)
{
static GType desktop_app_info_lookup_type = 0;
static volatile gsize g_define_type_id__volatile = 0;
if (! desktop_app_info_lookup_type)
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo desktop_app_info_lookup_info =
const GTypeInfo desktop_app_info_lookup_info =
{
sizeof (GDesktopAppInfoLookupIface), /* class_size */
g_desktop_app_info_lookup_base_init, /* base_init */
......@@ -2518,15 +2518,16 @@ g_desktop_app_info_lookup_get_type (void)
0, /* n_preallocs */
NULL
};
desktop_app_info_lookup_type =
GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GDesktopAppInfoLookup"),
&desktop_app_info_lookup_info, 0);
g_type_interface_add_prerequisite (desktop_app_info_lookup_type, G_TYPE_OBJECT);
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return desktop_app_info_lookup_type;
return g_define_type_id__volatile;
}
static void
......
......@@ -61,11 +61,11 @@ static void g_drive_class_init (gpointer g_class,
GType
g_drive_get_type (void)
{
static GType drive_type = 0;
static volatile gsize g_define_type_id__volatile = 0;
if (! drive_type)
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo drive_info =
const GTypeInfo drive_info =
{
sizeof (GDriveIface), /* class_size */
g_drive_base_init, /* base_init */
......@@ -77,15 +77,16 @@ g_drive_get_type (void)
0, /* n_preallocs */
NULL
};
drive_type =
GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GDrive"),
&drive_info, 0);
g_type_interface_add_prerequisite (drive_type, G_TYPE_OBJECT);
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return drive_type;
return g_define_type_id__volatile;
}
static void
......
......@@ -241,11 +241,11 @@ static gboolean g_file_real_copy_finish (GFile
GType
g_file_get_type (void)
{
static GType file_type = 0;
static volatile gsize g_define_type_id__volatile = 0;
if (! file_type)
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo file_info =
const GTypeInfo file_info =
{
sizeof (GFileIface), /* class_size */
g_file_base_init, /* base_init */
......@@ -257,15 +257,16 @@ g_file_get_type (void)
0, /* n_preallocs */
NULL
};
file_type =
GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GFile"),
&file_info, 0);
g_type_interface_add_prerequisite (file_type, G_TYPE_OBJECT);
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return file_type;
return g_define_type_id__volatile;
}
static void
......
......@@ -51,11 +51,11 @@ static void g_icon_class_init (gpointer g_class,
GType
g_icon_get_type (void)
{
static GType icon_type = 0;
static volatile gsize g_define_type_id__volatile = 0;
if (! icon_type)
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo icon_info =
const GTypeInfo icon_info =
{
sizeof (GIconIface), /* class_size */
g_icon_base_init, /* base_init */
......@@ -67,15 +67,16 @@ g_icon_get_type (void)
0, /* n_preallocs */
NULL
};
icon_type =
GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GIcon"),
&icon_info, 0);
g_type_interface_add_prerequisite (icon_type, G_TYPE_OBJECT);
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return icon_type;
return g_define_type_id__volatile;
}
static void
......
......@@ -55,11 +55,11 @@ static void g_loadable_icon_class_init (gpointer g_c
GType
g_loadable_icon_get_type (void)
{
static GType loadable_icon_type = 0;
static volatile gsize g_define_type_id__volatile = 0;
if (! loadable_icon_type)
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo loadable_icon_info =
const GTypeInfo loadable_icon_info =
{
sizeof (GLoadableIconIface), /* class_size */
g_loadable_icon_base_init, /* base_init */
......@@ -71,15 +71,16 @@ g_loadable_icon_get_type (void)
0, /* n_preallocs */
NULL
};
loadable_icon_type =
GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GLoadableIcon"),
&loadable_icon_info, 0);
g_type_interface_add_prerequisite (loadable_icon_type, G_TYPE_ICON);
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_ICON);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return loadable_icon_type;
return g_define_type_id__volatile;
}
static void
......
......@@ -70,11 +70,11 @@ static void g_mount_class_init (gpointer g_class,
GType
g_mount_get_type (void)
{
static GType mount_type = 0;
static volatile gsize g_define_type_id__volatile = 0;
if (! mount_type)
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo mount_info =
const GTypeInfo mount_info =
{
sizeof (GMountIface), /* class_size */
g_mount_base_init, /* base_init */
......@@ -86,15 +86,16 @@ g_mount_get_type (void)
0, /* n_preallocs */
NULL
};
mount_type =
GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GMount"),
&mount_info, 0);
g_type_interface_add_prerequisite (mount_type, G_TYPE_OBJECT);
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return mount_type;
return g_define_type_id__volatile;
}
static void
......
......@@ -44,11 +44,11 @@ static void g_seekable_base_init (gpointer g_class);
GType
g_seekable_get_type (void)
{
static GType seekable_type = 0;
static volatile gsize g_define_type_id__volatile = 0;
if (!seekable_type)
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo seekable_info =
const GTypeInfo seekable_info =
{
sizeof (GSeekableIface), /* class_size */
g_seekable_base_init, /* base_init */
......@@ -60,15 +60,16 @@ g_seekable_get_type (void)
0, /* n_preallocs */
NULL
};
seekable_type =
GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GSeekable"),
&seekable_info, 0);
g_type_interface_add_prerequisite (seekable_type, G_TYPE_OBJECT);
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return seekable_type;
return g_define_type_id__volatile;
}
static void
......
......@@ -80,11 +80,11 @@ static void g_volume_class_init (gpointer g_class,
GType
g_volume_get_type (void)
{
static GType volume_type = 0;
static volatile gsize g_define_type_id__volatile = 0;
if (! volume_type)
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo volume_info =
const GTypeInfo volume_info =
{
sizeof (GVolumeIface), /* class_size */
g_volume_base_init, /* base_init */
......@@ -96,15 +96,16 @@ g_volume_get_type (void)
0, /* n_preallocs */
NULL
};
volume_type =
GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GVolume"),
&volume_info, 0);
g_type_interface_add_prerequisite (volume_type, G_TYPE_OBJECT);
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return volume_type;
return g_define_type_id__volatile;
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment