mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
ext/ogg/gstoggdemux.c: The chain should be freed if we error out here, else it will leak.
Original commit message from CVS: * ext/ogg/gstoggdemux.c: (gst_ogg_demux_find_chains): The chain should be freed if we error out here, else it will leak. * gst/playback/gstdecodebin.c: (disconnect_unlinked_signals), (cleanup_decodebin): Don't forget to *properly* remove the signals, else it will leak.
This commit is contained in:
parent
dd65a6d76e
commit
fa877be84c
3 changed files with 41 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
|||
2007-06-23 Edward Hervey <edward@fluendo.com>
|
||||
|
||||
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_find_chains):
|
||||
The chain should be freed if we error out here, else it will leak.
|
||||
* gst/playback/gstdecodebin.c: (disconnect_unlinked_signals),
|
||||
(cleanup_decodebin):
|
||||
Don't forget to *properly* remove the signals, else it will leak.
|
||||
|
||||
2007-06-22 Jan Schmidt <thaytan@noraisin.net>
|
||||
|
||||
* MAINTAINERS:
|
||||
|
|
|
@ -2712,6 +2712,8 @@ no_first_chain:
|
|||
no_last_page:
|
||||
{
|
||||
GST_DEBUG_OBJECT (ogg, "can't get last page");
|
||||
if (chain)
|
||||
gst_ogg_chain_free (chain);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1575,6 +1575,34 @@ shutting_down:
|
|||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
disconnect_unlinked_signals (GstDecodeBin * decode_bin, GstElement * element)
|
||||
{
|
||||
GstIterator *pad_it = NULL;
|
||||
gboolean done = FALSE;
|
||||
|
||||
pad_it = gst_element_iterate_src_pads (element);
|
||||
while (!done) {
|
||||
GstPad *pad = NULL;
|
||||
|
||||
switch (gst_iterator_next (pad_it, (gpointer) & pad)) {
|
||||
case GST_ITERATOR_OK:
|
||||
g_signal_handlers_disconnect_by_func (pad, (gpointer) unlinked,
|
||||
decode_bin);
|
||||
gst_object_unref (pad);
|
||||
break;
|
||||
case GST_ITERATOR_RESYNC:
|
||||
gst_iterator_resync (pad_it);
|
||||
break;
|
||||
default:
|
||||
done = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
gst_iterator_free (pad_it);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cleanup_decodebin (GstDecodeBin * decode_bin)
|
||||
{
|
||||
|
@ -1600,8 +1628,7 @@ cleanup_decodebin (GstDecodeBin * decode_bin)
|
|||
case GST_ITERATOR_OK:
|
||||
if (element != decode_bin->typefind && element != decode_bin->fakesink) {
|
||||
GST_DEBUG_OBJECT (element, "removing autoplugged element");
|
||||
g_signal_handlers_disconnect_by_func (element, (gpointer) unlinked,
|
||||
decode_bin);
|
||||
disconnect_unlinked_signals (decode_bin, element);
|
||||
gst_element_set_state (element, GST_STATE_NULL);
|
||||
gst_bin_remove (GST_BIN (decode_bin), element);
|
||||
}
|
||||
|
@ -1651,6 +1678,8 @@ cleanup_decodebin (GstDecodeBin * decode_bin)
|
|||
if (GST_IS_PAD (typefind_pad)) {
|
||||
g_signal_handlers_unblock_by_func (typefind_pad, (gpointer) unlinked,
|
||||
decode_bin);
|
||||
g_signal_handlers_disconnect_by_func (typefind_pad, (gpointer) unlinked,
|
||||
decode_bin);
|
||||
gst_object_unref (typefind_pad);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue