From ec05d3b6d85af824d7984bff6adbd839b946d481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20J=C3=B6nsson?= Date: Thu, 6 Nov 2014 15:37:28 +0100 Subject: [PATCH] matroskamux: make GstMatroskamuxPad get_type() function thread-safe https://bugzilla.gnome.org/show_bug.cgi?id=739722 --- gst/matroska/matroska-mux.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index 2dd1326692..76f4633bd6 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -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; }