cogl: Do not unref a NULL object
Add return-if-fail statement to avoid deferencing NULL object
(cherry picked from commit 3104d697c0
)
This commit is contained in:
parent
1b439c42d1
commit
7076a48bcf
@ -109,7 +109,11 @@ _cogl_object_default_unref (void *object)
|
|||||||
void
|
void
|
||||||
cogl_object_unref (void *obj)
|
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);
|
unref_func (obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user