[mutter] cogl: Use memory management helpers more
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] cogl: Use memory management helpers more
- Date: Fri, 16 Oct 2020 16:25:59 +0000 (UTC)
commit 2aea404b149eda40665dd517c3baff5a1e79a288
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Oct 14 21:15:50 2020 +0200
cogl: Use memory management helpers more
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1496
cogl/cogl/cogl-framebuffer.c | 8 ++------
cogl/cogl/cogl-onscreen.c | 4 ++--
2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/cogl/cogl/cogl-framebuffer.c b/cogl/cogl/cogl-framebuffer.c
index ba33bfcbcc..1073685b62 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 d3585ba46f..651f3a7275 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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]