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
This commit is contained in:
Stian Selnes 2015-12-08 14:18:21 +01:00 committed by Tim-Philipp Müller
parent ed583832a1
commit dc4a3b71f0

View file

@ -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);