From 99a41cefe340d967a29f7e60b2fb8f84e1b15bee Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 1 Nov 2007 21:50:05 +0000 Subject: [PATCH] g_type_class_ref() other types as well, see #349410 and #64764. Original commit message from CVS: * gst/gst.c: (init_post): * gst/gstevent.c: (_gst_event_initialize): * gst/gstquery.c: (_gst_query_initialize): * libs/gst/dataprotocol/dataprotocol.c (gst_dp_init): g_type_class_ref() other types as well, see #349410 and #64764. * gst/gstbuffer.c: (_gst_buffer_initialize): * gst/gstmessage.c: (_gst_message_initialize): Simplify existing g_type_class_ref(). --- ChangeLog | 12 ++++++++++++ gst/gst.c | 16 ++++++++-------- gst/gstbuffer.c | 11 ++--------- gst/gstevent.c | 6 +++--- gst/gstmessage.c | 7 +------ gst/gstquery.c | 2 +- libs/gst/dataprotocol/dataprotocol.c | 2 +- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index b1b1534..1be321e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2007-11-01 Tim-Philipp Müller + * gst/gst.c: (init_post): + * gst/gstevent.c: (_gst_event_initialize): + * gst/gstquery.c: (_gst_query_initialize): + * libs/gst/dataprotocol/dataprotocol.c (gst_dp_init): + g_type_class_ref() other types as well, see #349410 and #64764. + + * gst/gstbuffer.c: (_gst_buffer_initialize): + * gst/gstmessage.c: (_gst_message_initialize): + Simplify existing g_type_class_ref(). + +2007-11-01 Tim-Philipp Müller + * gst/gstformat.c: (_gst_format_initialize): g_type_class_ref() our GstFormat type to make sure we avoid the thread-unsafe bits of the GObject/GType system, ie. bug #349410 and diff --git a/gst/gst.c b/gst/gst.c index 9573af1..da42114 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -968,15 +968,15 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data, _priv_gst_quarks_initialize (); _gst_format_initialize (); _gst_query_initialize (); - gst_object_get_type (); - gst_pad_get_type (); - gst_element_factory_get_type (); - gst_element_get_type (); - gst_type_find_factory_get_type (); - gst_bin_get_type (); + g_type_class_ref (gst_object_get_type ()); + g_type_class_ref (gst_pad_get_type ()); + g_type_class_ref (gst_element_factory_get_type ()); + g_type_class_ref (gst_element_get_type ()); + g_type_class_ref (gst_type_find_factory_get_type ()); + g_type_class_ref (gst_bin_get_type ()); #ifndef GST_DISABLE_INDEX - gst_index_factory_get_type (); + g_type_class_ref (gst_index_factory_get_type ()); #endif /* GST_DISABLE_INDEX */ #ifndef GST_DISABLE_URI gst_uri_handler_get_type (); @@ -984,7 +984,7 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data, gst_structure_get_type (); _gst_value_initialize (); - gst_param_spec_fraction_get_type (); + g_type_class_ref (gst_param_spec_fraction_get_type ()); gst_caps_get_type (); _gst_event_initialize (); _gst_buffer_initialize (); diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index c553ac1..cf26d77 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -132,18 +132,11 @@ static GType _gst_buffer_type = 0; void _gst_buffer_initialize (void) { - gpointer ptr; - - gst_buffer_get_type (); - gst_subbuffer_get_type (); - /* the GstMiniObject types need to be class_ref'd once before it can be * done from multiple threads; * see http://bugzilla.gnome.org/show_bug.cgi?id=304551 */ - ptr = g_type_class_ref (GST_TYPE_BUFFER); - g_type_class_unref (ptr); - ptr = g_type_class_ref (_gst_subbuffer_type); - g_type_class_unref (ptr); + g_type_class_ref (gst_buffer_get_type ()); + g_type_class_ref (gst_subbuffer_get_type ()); } GType diff --git a/gst/gstevent.c b/gst/gstevent.c index 2953c18..0357581 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -92,9 +92,9 @@ static GstEvent *_gst_event_copy (GstEvent * event); void _gst_event_initialize (void) { - gst_event_get_type (); - gst_seek_flags_get_type (); - gst_seek_type_get_type (); + g_type_class_ref (gst_event_get_type ()); + g_type_class_ref (gst_seek_flags_get_type ()); + g_type_class_ref (gst_seek_type_get_type ()); } typedef struct diff --git a/gst/gstmessage.c b/gst/gstmessage.c index 81f0105..820d3e2 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -67,17 +67,12 @@ static GstMessage *_gst_message_copy (GstMessage * message); void _gst_message_initialize (void) { - gpointer ptr; - GST_CAT_INFO (GST_CAT_GST_INIT, "init messages"); - gst_message_get_type (); - /* the GstMiniObject types need to be class_ref'd once before it can be * done from multiple threads; * see http://bugzilla.gnome.org/show_bug.cgi?id=304551 */ - ptr = g_type_class_ref (GST_TYPE_MESSAGE); - g_type_class_unref (ptr); + g_type_class_ref (gst_message_get_type ()); } typedef struct diff --git a/gst/gstquery.c b/gst/gstquery.c index 3ebe70b..fde1d61 100644 --- a/gst/gstquery.c +++ b/gst/gstquery.c @@ -119,7 +119,7 @@ _gst_query_initialize (void) } g_static_mutex_unlock (&mutex); - gst_query_get_type (); + g_type_class_ref (gst_query_get_type ()); } /** diff --git a/libs/gst/dataprotocol/dataprotocol.c b/libs/gst/dataprotocol/dataprotocol.c index 949fd729..b5dea2a 100644 --- a/libs/gst/dataprotocol/dataprotocol.c +++ b/libs/gst/dataprotocol/dataprotocol.c @@ -327,7 +327,7 @@ gst_dp_init (void) _gst_dp_initialized = TRUE; - gst_dp_version_get_type (); + g_type_class_ref (gst_dp_version_get_type ()); GST_DEBUG_CATEGORY_INIT (data_protocol_debug, "gdp", 0, "GStreamer Data Protocol"); -- 2.7.4