diff --git a/cogl/cogl/cogl-framebuffer.c b/cogl/cogl/cogl-framebuffer.c index ba33bfcbc..1073685b6 100644 --- a/cogl/cogl/cogl-framebuffer.c +++ b/cogl/cogl/cogl-framebuffer.c @@ -887,13 +887,9 @@ _cogl_framebuffer_flush_dependency_journals (CoglFramebuffer *framebuffer) { CoglFramebufferPrivate *priv = cogl_framebuffer_get_instance_private (framebuffer); - GList *l; - for (l = priv->deps; l; l = l->next) - _cogl_framebuffer_flush_journal (l->data); - for (l = priv->deps; l; l = l->next) - g_object_unref (l->data); - g_list_free (priv->deps); + g_list_foreach (priv->deps, (GFunc) _cogl_framebuffer_flush_journal, NULL); + g_list_free_full (priv->deps, g_object_unref); priv->deps = NULL; } diff --git a/cogl/cogl/cogl-onscreen.c b/cogl/cogl/cogl-onscreen.c index d3585ba46..651f3a727 100644 --- a/cogl/cogl/cogl-onscreen.c +++ b/cogl/cogl/cogl-onscreen.c @@ -198,8 +198,8 @@ _cogl_dispatch_onscreen_cb (CoglContext *context) _cogl_list_insert_list (&queue, &context->onscreen_events_queue); _cogl_list_init (&context->onscreen_events_queue); - _cogl_closure_disconnect (context->onscreen_dispatch_idle); - context->onscreen_dispatch_idle = NULL; + g_clear_pointer (&context->onscreen_dispatch_idle, + _cogl_closure_disconnect); _cogl_list_for_each_safe (event, tmp, &queue, link) {