diff --git a/cogl/cogl/cogl-object.c b/cogl/cogl/cogl-object.c index 1b849d58c..e159c6c3a 100644 --- a/cogl/cogl/cogl-object.c +++ b/cogl/cogl/cogl-object.c @@ -109,7 +109,11 @@ _cogl_object_default_unref (void *object) void cogl_object_unref (void *obj) { - void (* unref_func) (void *) = ((CoglObject *) obj)->klass->virt_unref; + void (* unref_func) (void *); + + _COGL_RETURN_IF_FAIL (obj != NULL); + + unref_func = ((CoglObject *) obj)->klass->virt_unref; unref_func (obj); }