gst/: Make sure the class is reffed/unreffed once before threads can be used. Fixes...
authorThomas Vander Stichele <thomas@apestaart.org>
Tue, 17 May 2005 17:50:41 +0000 (17:50 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Tue, 17 May 2005 17:50:41 +0000 (17:50 +0000)
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
gst/gst.c
gst/gstmessage.c

index d78be45..c2f5b8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-05-17  Thomas Vander Stichele  <thomas (at) apestaart (dot) org>
+
+       * 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  <wim@fluendo.com>
 
        * gst/base/gstbasesink.c: (gst_basesink_finish_preroll),
index b1f7ffa..e7458c8 100644 (file)
--- 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 */
index 272945f..828e71c 100644 (file)
@@ -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