From 814a9de9d8ba64dab7648ac37793032de4c82e97 Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Tue, 22 Aug 2023 21:55:17 +0200 Subject: [PATCH] cogl: Chain up to dispose() We forgot to chain up to the parent class' `dispose()` vfunc in both `CoglPangoRenderer` and `CoglFrameBuffer`. Plugs 2 (probably tiny) memory leaks. Part-of: --- cogl/cogl-pango/cogl-pango-render.c | 8 +++----- cogl/cogl/cogl-framebuffer.c | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cogl/cogl-pango/cogl-pango-render.c b/cogl/cogl-pango/cogl-pango-render.c index 2e175d6a4..937bd00b8 100644 --- a/cogl/cogl-pango/cogl-pango-render.c +++ b/cogl/cogl-pango/cogl-pango-render.c @@ -286,11 +286,9 @@ cogl_pango_renderer_dispose (GObject *object) { CoglPangoRenderer *priv = COGL_PANGO_RENDERER (object); - if (priv->ctx) - { - cogl_object_unref (priv->ctx); - priv->ctx = NULL; - } + cogl_clear_object (&priv->ctx); + + G_OBJECT_CLASS (cogl_pango_renderer_parent_class)->dispose (object); } static void diff --git a/cogl/cogl/cogl-framebuffer.c b/cogl/cogl/cogl-framebuffer.c index 5e2026bc8..f0499f31a 100644 --- a/cogl/cogl/cogl-framebuffer.c +++ b/cogl/cogl/cogl-framebuffer.c @@ -356,6 +356,8 @@ cogl_framebuffer_dispose (GObject *object) ctx->current_read_buffer = NULL; g_clear_object (&priv->driver); + + G_OBJECT_CLASS (cogl_framebuffer_parent_class)->dispose (object); } static void