cogl/framebuffer: Clean up cleanup function

Use cogl_clear_object() and g_clear_pointer() helpers.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1496
This commit is contained in:
Jonas Ådahl 2020-10-13 09:19:00 +02:00 committed by Georges Basile Stavracas Neto
parent aa99e505ad
commit e7ac3e2715

View File

@ -283,15 +283,11 @@ _cogl_framebuffer_free (CoglFramebuffer *framebuffer)
_cogl_fence_cancel_fences_for_framebuffer (framebuffer);
_cogl_clip_stack_unref (priv->clip_stack);
cogl_object_unref (priv->modelview_stack);
priv->modelview_stack = NULL;
cogl_object_unref (priv->projection_stack);
priv->projection_stack = NULL;
cogl_object_unref (priv->journal);
g_clear_pointer (&priv->clip_stack, _cogl_clip_stack_unref);
cogl_clear_object (&priv->modelview_stack);
cogl_clear_object (&priv->projection_stack);
cogl_clear_object (&priv->journal);
ctx->framebuffers = g_list_remove (ctx->framebuffers, framebuffer);