diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-02-11 20:14:59 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-02-12 00:02:16 +0000 |
commit | 33a38153f4b50289d4763640b6aca44e8eaefe01 (patch) | |
tree | 47245934227fe8fd33a972b189e9f32d38b8df5c | |
parent | 09af623bf33ed360792917fa0971c8b4edff8257 (diff) |
gst-launch: don't leak timeout GSource
-rw-r--r-- | tools/gst-launch.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/gst-launch.c b/tools/gst-launch.c index 38acb754d..caca18b67 100644 --- a/tools/gst-launch.c +++ b/tools/gst-launch.c @@ -387,6 +387,9 @@ play_signal_setup (void) static EventLoopResult event_loop (GstElement * pipeline, gboolean blocking, GstState target_state) { +#ifndef DISABLE_FAULT_HANDLER + gulong timeout_id; +#endif GstBus *bus; GstMessage *message = NULL; 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)); #ifndef DISABLE_FAULT_HANDLER - g_timeout_add (250, (GSourceFunc) check_intr, pipeline); + timeout_id = g_timeout_add (250, (GSourceFunc) check_intr, pipeline); #endif while (TRUE) { @@ -653,6 +656,9 @@ exit: if (message) gst_message_unref (message); gst_object_unref (bus); +#ifndef DISABLE_FAULT_HANDLER + g_source_remove (timeout_id); +#endif return res; } } |