From: Sebastian Rasmussen Date: Wed, 6 Aug 2014 11:41:46 +0000 (+0200) Subject: tests: Add missing unrefs of objects after use X-Git-Tag: 1.19.3~511^2~4403 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9995054e80a1c446a6b3bf909dfb226422191e81;p=platform%2Fupstream%2Fgstreamer.git tests: Add missing unrefs of objects after use Unreffing the objects returned by gst_bin_get_by_name() and gst_pipeline_get_use() were missing in several tests, so add these. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734359 --- diff --git a/tests/check/elements/appsrc.c b/tests/check/elements/appsrc.c index c31ed4c..29371ba 100644 --- a/tests/check/elements/appsrc.c +++ b/tests/check/elements/appsrc.c @@ -150,6 +150,7 @@ on_source_message (GstBus * bus, GstMessage * message, ProgramData * data) source = gst_bin_get_by_name (GST_BIN (data->sink), "testsource"); fail_unless (gst_app_src_end_of_stream (GST_APP_SRC (source)) == GST_FLOW_OK); + gst_object_unref (source); break; case GST_MESSAGE_ERROR: g_main_loop_quit (data->loop); diff --git a/tests/examples/app/appsink-src.c b/tests/examples/app/appsink-src.c index ecf7f05..0c31c4a 100644 --- a/tests/examples/app/appsink-src.c +++ b/tests/examples/app/appsink-src.c @@ -24,6 +24,7 @@ on_new_sample_from_sink (GstElement * elt, ProgramData * data) GstSample *sample; GstBuffer *app_buffer, *buffer; GstElement *source; + GstFlowReturn ret; /* get the sample from appsink */ sample = gst_app_sink_pull_sample (GST_APP_SINK (elt)); @@ -37,7 +38,10 @@ on_new_sample_from_sink (GstElement * elt, ProgramData * data) /* get source an push new buffer */ source = gst_bin_get_by_name (GST_BIN (data->sink), "testsource"); - return gst_app_src_push_buffer (GST_APP_SRC (source), app_buffer); + ret = gst_app_src_push_buffer (GST_APP_SRC (source), app_buffer); + gst_object_unref (source); + + return ret; } /* called when we get a GstMessage from the source pipeline when we get EOS, we @@ -52,6 +56,7 @@ on_source_message (GstBus * bus, GstMessage * message, ProgramData * data) g_print ("The source got dry\n"); source = gst_bin_get_by_name (GST_BIN (data->sink), "testsource"); gst_app_src_end_of_stream (GST_APP_SRC (source)); + gst_object_unref (source); break; case GST_MESSAGE_ERROR: g_print ("Received error\n"); diff --git a/tests/examples/audio/audiomix.c b/tests/examples/audio/audiomix.c index dfe95c8..2b87f39 100644 --- a/tests/examples/audio/audiomix.c +++ b/tests/examples/audio/audiomix.c @@ -206,6 +206,7 @@ main (int argc, char *argv[]) gtk_main (); gst_element_set_state (pipeline, GST_STATE_NULL); gst_object_unref (pipeline); + gst_object_unref (bus); return 0; } diff --git a/tests/examples/audio/volume.c b/tests/examples/audio/volume.c index 5e0d5ef..26d6bb1 100644 --- a/tests/examples/audio/volume.c +++ b/tests/examples/audio/volume.c @@ -170,6 +170,7 @@ main (int argc, char *argv[]) gtk_main (); gst_element_set_state (pipeline, GST_STATE_NULL); gst_object_unref (pipeline); + gst_object_unref (bus); return 0; } diff --git a/tests/examples/dynamic/codec-select.c b/tests/examples/dynamic/codec-select.c index 0169370..b01d554 100644 --- a/tests/examples/dynamic/codec-select.c +++ b/tests/examples/dynamic/codec-select.c @@ -214,6 +214,7 @@ do_switch (GstElement * pipeline) /* set the active pad */ g_object_set (select, "active-pad", pad, NULL); + gst_object_unref (select); return TRUE; } diff --git a/tests/examples/seek/scrubby.c b/tests/examples/seek/scrubby.c index ac5b2b4..7ba3600 100644 --- a/tests/examples/seek/scrubby.c +++ b/tests/examples/seek/scrubby.c @@ -559,6 +559,8 @@ main (int argc, char **argv) g_print ("NULL pipeline\n"); gst_element_set_state (pipeline, GST_STATE_NULL); + gst_object_unref (bus); + g_print ("free pipeline\n"); gst_object_unref (pipeline); diff --git a/tests/examples/snapshot/snapshot.c b/tests/examples/snapshot/snapshot.c index 4ddad45..3ebdc15 100644 --- a/tests/examples/snapshot/snapshot.c +++ b/tests/examples/snapshot/snapshot.c @@ -104,6 +104,7 @@ main (int argc, char *argv[]) /* get the preroll buffer from appsink, this block untils appsink really * prerolls */ g_signal_emit_by_name (sink, "pull-preroll", &sample, NULL); + gst_object_unref (sink); /* if we have a buffer now, convert it to a pixbuf. It's possible that we * don't have a buffer because we went EOS right away or had an error. */ diff --git a/tests/icles/stress-videooverlay.c b/tests/icles/stress-videooverlay.c index 433aca2..c7e127c 100644 --- a/tests/icles/stress-videooverlay.c +++ b/tests/icles/stress-videooverlay.c @@ -242,5 +242,7 @@ main (int argc, char **argv) g_main_loop_unref (loop); + gst_object_unref (bus); + return 0; } diff --git a/tests/icles/test-textoverlay.c b/tests/icles/test-textoverlay.c index c1c59d5..13a2b3f 100644 --- a/tests/icles/test-textoverlay.c +++ b/tests/icles/test-textoverlay.c @@ -106,6 +106,7 @@ test_textoverlay (int width, int height) } } + gst_object_unref (toverlay); g_free (pstr); }