diff --git a/ChangeLog b/ChangeLog index a64ff3403b..79b32be333 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-06-04 Michael Smith + + * gst/playback/gstplaybasebin.c: + Disconnect signals from decodebins we created before we remove it from + playbin, to avoid crashes if the decodebin is eventually disposed after + the playbin itself (possible if the app takes a reference on the + decodebin). + Fixes #536521. + 2008-06-04 Tim-Philipp Müller * gst/typefind/gsttypefindfunctions.c: (aac_type_find), diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index d44f272002..8bd9cdbf26 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -1936,6 +1936,19 @@ remove_decoders (GstPlayBaseBin * bin) GstElement *decoder = GST_ELEMENT_CAST (walk->data); GST_DEBUG_OBJECT (bin, "removing old decoder element"); + /* Disconnect all the signal handlers we attached to the decodebin before + * we dispose of it */ + g_signal_handlers_disconnect_by_func (decoder, + G_CALLBACK (decodebin_element_added_cb), bin); + g_signal_handlers_disconnect_by_func (decoder, + G_CALLBACK (decodebin_element_removed_cb), bin); + g_signal_handlers_disconnect_by_func (decoder, + G_CALLBACK (new_decoded_pad), bin); + g_signal_handlers_disconnect_by_func (decoder, + G_CALLBACK (no_more_pads), bin); + g_signal_handlers_disconnect_by_func (decoder, + G_CALLBACK (unknown_type), bin); + gst_element_set_state (decoder, GST_STATE_NULL); gst_bin_remove (GST_BIN_CAST (bin), decoder); }