nle: Avoid unsetting srcpad target after the srcpad is already freed

That leaded to segfaults
This commit is contained in:
Thibault Saunier 2015-09-15 12:17:19 +02:00
parent 69e9acc823
commit c8e9cf962c

View file

@ -214,8 +214,9 @@ element_pad_removed_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad,
GST_DEBUG_OBJECT (source, "Clearing up ghostpad");
nle_object_ghost_pad_set_target (NLE_OBJECT (source), nleobject->srcpad,
NULL);
if (nleobject->srcpad)
nle_object_ghost_pad_set_target (NLE_OBJECT (source), nleobject->srcpad,
NULL);
priv->ghostedpad = NULL;
} else {
GST_DEBUG_OBJECT (source, "The removed pad is NOT our controlled pad");