diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index 763d6d05a0..b36cd8a28c 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -95,6 +95,7 @@ static GPrivate main_thread_priv; */ struct _GstValidateScenarioPrivate { + GstBus *bus; GstValidateRunner *runner; gboolean execute_on_idle; @@ -2102,6 +2103,12 @@ gst_validate_scenario_dispose (GObject * object) (GWeakNotify) _pipeline_freed_cb, object); g_list_free_full (priv->actions, (GDestroyNotify) gst_validate_action_unref); + if (priv->bus) { + gst_bus_remove_signal_watch (priv->bus); + gst_object_unref (priv->bus); + priv->bus = NULL; + } + G_OBJECT_CLASS (gst_validate_scenario_parent_class)->dispose (object); } @@ -2176,7 +2183,6 @@ GstValidateScenario * gst_validate_scenario_factory_create (GstValidateRunner * runner, GstElement * pipeline, const gchar * scenario_name) { - GstBus *bus; GstValidateScenario *scenario = g_object_new (GST_TYPE_VALIDATE_SCENARIO, "validate-runner", runner, NULL); @@ -2197,10 +2203,10 @@ gst_validate_scenario_factory_create (GstValidateRunner * g_signal_connect (pipeline, "element-added", (GCallback) _element_added_cb, scenario); - bus = gst_element_get_bus (pipeline); - gst_bus_add_signal_watch (bus); - g_signal_connect (bus, "message", (GCallback) message_cb, scenario); - gst_object_unref (bus); + scenario->priv->bus = gst_element_get_bus (pipeline); + gst_bus_add_signal_watch (scenario->priv->bus); + g_signal_connect (scenario->priv->bus, "message", (GCallback) message_cb, + scenario); if (scenario->priv->handles_state) { GST_INFO_OBJECT (scenario, "Scenario handles state," diff --git a/validate/gst/validate/media-descriptor-writer.c b/validate/gst/validate/media-descriptor-writer.c index 03bf988ffd..13735eef76 100644 --- a/validate/gst/validate/media-descriptor-writer.c +++ b/validate/gst/validate/media-descriptor-writer.c @@ -495,6 +495,7 @@ _run_frame_analisis (GstMediaDescriptorWriter * writer, writer->priv->pipeline = NULL; g_main_loop_unref (writer->priv->loop); writer->priv->loop = NULL; + gst_bus_remove_signal_watch (bus); gst_object_unref (bus); return TRUE; diff --git a/validate/tools/gst-validate-transcoding.c b/validate/tools/gst-validate-transcoding.c index 002319a90b..f80eee36d8 100644 --- a/validate/tools/gst-validate-transcoding.c +++ b/validate/tools/gst-validate-transcoding.c @@ -918,7 +918,6 @@ main (int argc, gchar ** argv) bus = gst_element_get_bus (pipeline); gst_bus_add_signal_watch (bus); g_signal_connect (bus, "message", (GCallback) bus_callback, mainloop); - gst_object_unref (bus); g_print ("Starting pipeline\n"); sret = gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -946,6 +945,9 @@ main (int argc, gchar ** argv) ret = rep_err; exit: + gst_bus_remove_signal_watch (bus); + gst_object_unref (bus); + gst_element_set_state (pipeline, GST_STATE_NULL); g_main_loop_unref (mainloop); g_object_unref (pipeline); diff --git a/validate/tools/gst-validate.c b/validate/tools/gst-validate.c index 274c326c4b..de809207ce 100644 --- a/validate/tools/gst-validate.c +++ b/validate/tools/gst-validate.c @@ -605,6 +605,7 @@ main (int argc, gchar ** argv) /* Clean the bus */ gst_bus_set_flushing (bus, TRUE); + gst_bus_remove_signal_watch (bus); gst_object_unref (bus); rep_err = gst_validate_runner_printf (runner);