diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2019-04-10 10:18:54 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-05-02 10:31:25 +0300 |
commit | 10e2cb84f8da4efa26203247df6065379cdb319d (patch) | |
tree | 1146417cbe58a5f13aaca10aa3dd70ebf9f5e0ee | |
parent | 1f9b375f96c7548f78807be615cdb95dce83c2df (diff) |
controlbinding: Check if the weak pointer was cleared before explicitly removing it
Otherwise we'll get an assertion if the object behind the weak pointer
was already destroyed in the meantime as we would pass NULL as first
argument to g_object_remove_weak_pointer().
-rw-r--r-- | gst/gstcontrolbinding.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gst/gstcontrolbinding.c b/gst/gstcontrolbinding.c index 0d73948f66..845bc953f1 100644 --- a/gst/gstcontrolbinding.c +++ b/gst/gstcontrolbinding.c @@ -176,8 +176,9 @@ gst_control_binding_dispose (GObject * object) GstControlBinding *self = GST_CONTROL_BINDING (object); /* we did not took a reference */ - g_object_remove_weak_pointer ((GObject *) self->__object, - (gpointer *) & self->__object); + if (self->__object) + g_object_remove_weak_pointer ((GObject *) self->__object, + (gpointer *) & self->__object); self->__object = NULL; g_weak_ref_clear (&self->ABI.abi.priv->object); |