From dc4a3b71f09ed4de523f564d9a43c47d66b9e0ab Mon Sep 17 00:00:00 2001 From: Stian Selnes Date: Tue, 8 Dec 2015 14:18:21 +0100 Subject: [PATCH] harness: Unset sink_forward_pad before tearing down sink_harness Set the sink_forward_pad to NULL before tearing down sink_harness to avoid that the harness tries to forward events/queries to it while it's tearing down. https://bugzilla.gnome.org/show_bug.cgi?id=761904 --- libs/gst/check/gstharness.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/gst/check/gstharness.c b/libs/gst/check/gstharness.c index 4590b0d..979d423 100644 --- a/libs/gst/check/gstharness.c +++ b/libs/gst/check/gstharness.c @@ -913,6 +913,7 @@ gst_harness_teardown (GstHarness * h) gst_harness_teardown (h->src_harness); } + gst_object_replace ((GstObject **) & priv->sink_forward_pad, NULL); if (h->sink_harness) { gst_harness_teardown (h->sink_harness); } @@ -946,9 +947,6 @@ gst_harness_teardown (GstHarness * h) g_async_queue_unref (priv->sink_event_queue); } - if (priv->sink_forward_pad) - gst_object_unref (priv->sink_forward_pad); - gst_object_replace ((GstObject **) & priv->propose_allocator, NULL); gst_object_replace ((GstObject **) & priv->allocator, NULL); gst_object_replace ((GstObject **) & priv->pool, NULL); @@ -2235,8 +2233,8 @@ gst_harness_add_sink_harness (GstHarness * h, GstHarness * sink_harness) GstHarnessPrivate *priv = h->priv; if (h->sink_harness) { + gst_object_replace ((GstObject **) &priv->sink_forward_pad, NULL); gst_harness_teardown (h->sink_harness); - gst_object_unref (priv->sink_forward_pad); } h->sink_harness = sink_harness; priv->sink_forward_pad = gst_object_ref (h->sink_harness->srcpad); -- 2.7.4