Commit 5d38f0d3 authored by Sebastian Dröge's avatar Sebastian Dröge

gio: Remove the bus GSource from the main context

Prevents a valgrind warning about possibly leaked memory,
see bug #647763.
parent 99b6b1bb
...@@ -63,15 +63,14 @@ GST_START_TEST (test_memory_stream) ...@@ -63,15 +63,14 @@ GST_START_TEST (test_memory_stream)
GstElement *bin; GstElement *bin;
GstElement *src, *sink; GstElement *src, *sink;
GstBus *bus; GstBus *bus;
GMemoryInputStream *input; GMemoryInputStream *input;
GMemoryOutputStream *output; GMemoryOutputStream *output;
guint8 *in_data; guint8 *in_data;
guint8 *out_data; guint8 *out_data;
gint i; gint i;
GstFormat fmt = GST_FORMAT_BYTES; GstFormat fmt = GST_FORMAT_BYTES;
gint64 duration; gint64 duration;
guint bus_watch = 0;
got_eos = FALSE; got_eos = FALSE;
...@@ -105,7 +104,7 @@ GST_START_TEST (test_memory_stream) ...@@ -105,7 +104,7 @@ GST_START_TEST (test_memory_stream)
fail_unless (gst_element_link_many (src, sink, NULL)); fail_unless (gst_element_link_many (src, sink, NULL));
bus = gst_element_get_bus (bin); bus = gst_element_get_bus (bin);
gst_bus_add_watch (bus, message_handler, loop); bus_watch = gst_bus_add_watch (bus, message_handler, loop);
gst_object_unref (bus); gst_object_unref (bus);
gst_element_set_state (bin, GST_STATE_PAUSED); gst_element_set_state (bin, GST_STATE_PAUSED);
...@@ -147,6 +146,7 @@ GST_START_TEST (test_memory_stream) ...@@ -147,6 +146,7 @@ GST_START_TEST (test_memory_stream)
g_object_unref (output); g_object_unref (output);
g_main_loop_unref (loop); g_main_loop_unref (loop);
g_source_remove (bus_watch);
} }
GST_END_TEST; GST_END_TEST;
......
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