mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
gst-launch: don't leak timeout GSource
This commit is contained in:
parent
09af623bf3
commit
33a38153f4
1 changed files with 7 additions and 1 deletions
|
@ -387,6 +387,9 @@ play_signal_setup (void)
|
||||||
static EventLoopResult
|
static EventLoopResult
|
||||||
event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
|
event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
|
||||||
{
|
{
|
||||||
|
#ifndef DISABLE_FAULT_HANDLER
|
||||||
|
gulong timeout_id;
|
||||||
|
#endif
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstMessage *message = NULL;
|
GstMessage *message = NULL;
|
||||||
EventLoopResult res = ELR_NO_ERROR;
|
EventLoopResult res = ELR_NO_ERROR;
|
||||||
|
@ -395,7 +398,7 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
|
||||||
bus = gst_element_get_bus (GST_ELEMENT (pipeline));
|
bus = gst_element_get_bus (GST_ELEMENT (pipeline));
|
||||||
|
|
||||||
#ifndef DISABLE_FAULT_HANDLER
|
#ifndef DISABLE_FAULT_HANDLER
|
||||||
g_timeout_add (250, (GSourceFunc) check_intr, pipeline);
|
timeout_id = g_timeout_add (250, (GSourceFunc) check_intr, pipeline);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
|
@ -653,6 +656,9 @@ exit:
|
||||||
if (message)
|
if (message)
|
||||||
gst_message_unref (message);
|
gst_message_unref (message);
|
||||||
gst_object_unref (bus);
|
gst_object_unref (bus);
|
||||||
|
#ifndef DISABLE_FAULT_HANDLER
|
||||||
|
g_source_remove (timeout_id);
|
||||||
|
#endif
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue