diff --git a/gst/gsttypefind.c b/gst/gsttypefind.c index 4be2265728..8cf427b336 100644 --- a/gst/gsttypefind.c +++ b/gst/gsttypefind.c @@ -186,12 +186,15 @@ gst_typefind_chain (GstPad *pad, GstBuffer *buf) { int oldstate = GST_STATE(typefind); + gst_object_ref (GST_OBJECT (typefind)); gtk_signal_emit (GTK_OBJECT (typefind), gst_typefind_signals[HAVE_TYPE], typefind->caps); if (GST_STATE(typefind) != oldstate) { + gst_object_unref (GST_OBJECT (typefind)); GST_DEBUG(0, "state changed during signal, aborting\n"); cothread_switch(cothread_current_main()); } + gst_object_unref (GST_OBJECT (typefind)); } gst_pad_set_caps (pad, caps);