From e0c9d4f8799d71faacdc3b7f90690f56fb3097bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 10 Apr 2019 10:18:54 +0300 Subject: [PATCH] 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(). --- gst/gstcontrolbinding.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst/gstcontrolbinding.c b/gst/gstcontrolbinding.c index bed5e01..568f82f 100644 --- a/gst/gstcontrolbinding.c +++ b/gst/gstcontrolbinding.c @@ -172,8 +172,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); -- 2.7.4