matroskamux: make GstMatroskamuxPad get_type() function thread-safe

https://bugzilla.gnome.org/show_bug.cgi?id=739722
This commit is contained in:
Göran Jönsson 2014-11-06 15:37:28 +01:00 committed by Tim-Philipp Müller
parent 36532f5070
commit ec05d3b6d8

View file

@ -365,11 +365,12 @@ gst_matroskamux_pad_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
type = g_type_register_static_simple (GST_TYPE_PAD,
if (g_once_init_enter (&type)) {
GType tmp = g_type_register_static_simple (GST_TYPE_PAD,
g_intern_static_string ("GstMatroskamuxPad"), sizeof (GstPadClass),
(GClassInitFunc) gst_matroskamux_pad_class_init,
sizeof (GstMatroskamuxPad), NULL, 0);
g_once_init_leave (&type, tmp);
}
return type;
}