Commit b43db2f2 authored by Thiago Santos's avatar Thiago Santos
Browse files

streamsplitter: release pending events refs

Unref pending events when disposing the streamsplitter.

Also refactor a little to replace a for with a g_list_foreach
parent fc608d4d
...@@ -88,6 +88,11 @@ gst_stream_splitter_dispose (GObject * object) ...@@ -88,6 +88,11 @@ gst_stream_splitter_dispose (GObject * object)
stream_splitter->lock = NULL; stream_splitter->lock = NULL;
} }
g_list_foreach (stream_splitter->pending_events, (GFunc) gst_event_unref,
NULL);
g_list_free (stream_splitter->pending_events);
stream_splitter->pending_events = NULL;
G_OBJECT_CLASS (gst_stream_splitter_parent_class)->dispose (object); G_OBJECT_CLASS (gst_stream_splitter_parent_class)->dispose (object);
} }
...@@ -173,9 +178,8 @@ gst_stream_splitter_sink_event (GstPad * pad, GstEvent * event) ...@@ -173,9 +178,8 @@ gst_stream_splitter_sink_event (GstPad * pad, GstEvent * event)
} }
if (flushpending) { if (flushpending) {
GList *tmp; g_list_foreach (stream_splitter->pending_events, (GFunc) gst_event_unref,
for (tmp = stream_splitter->pending_events; tmp; tmp = tmp->next) NULL);
gst_event_unref ((GstEvent *) tmp->data);
g_list_free (stream_splitter->pending_events); g_list_free (stream_splitter->pending_events);
stream_splitter->pending_events = NULL; stream_splitter->pending_events = NULL;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment