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.
This commit is contained in:
Thomas Vander Stichele 2005-05-17 17:50:41 +00:00
parent 576b2181d8
commit cb9388c96e
3 changed files with 16 additions and 0 deletions

View file

@ -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),

View file

@ -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 */

View 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