From cb9388c96eff1f1101aad1fc0339f1e78280ece0 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Tue, 17 May 2005 17:50:41 +0000 Subject: [PATCH] gst/: Make sure the class is reffed/unreffed once before threads can be used. Fixes #304551. Original commit message from CVS: * gst/gst.c: * gst/gstmessage.c: Make sure the class is reffed/unreffed once before threads can be used. Fixes #304551. --- ChangeLog | 7 +++++++ gst/gst.c | 1 + gst/gstmessage.c | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index d78be45..c2f5b8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-05-17 Thomas Vander Stichele + + * gst/gst.c: + * gst/gstmessage.c: + Make sure the class is reffed/unreffed once before threads can be + used. Fixes #304551. + 2005-05-17 Wim Taymans * gst/base/gstbasesink.c: (gst_basesink_finish_preroll), diff --git a/gst/gst.c b/gst/gst.c index b1f7ffa..e7458c8 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -593,6 +593,7 @@ init_post (void) gst_scheduler_factory_get_type (); gst_type_find_factory_get_type (); gst_bin_get_type (); + #ifndef GST_DISABLE_INDEX gst_index_factory_get_type (); #endif /* GST_DISABLE_INDEX */ diff --git a/gst/gstmessage.c b/gst/gstmessage.c index 272945f..828e71c 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -43,10 +43,18 @@ 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); + #ifndef GST_DISABLE_TRACE _message_trace = gst_alloc_trace_register (GST_MESSAGE_TRACE_NAME); #endif -- 2.7.4