[gimp] Issue #7115: properly chaining up finalize() methods.



commit cc578608378435cd6a6f1575df04015701356e2a
Author: Jehan <jehan girinstud io>
Date:   Wed Aug 4 01:59:41 2021 +0200

    Issue #7115: properly chaining up finalize() methods.
    
    Thanks to Massimo Valentini for finding these.
    Fixes:
    
    > GLib-GObject-CRITICAL **: 13:21:53.256: Object 0x5485140 of type GimpLineArt not finalized correctly.
    > GLib-GObject-CRITICAL **: 13:21:57.472: Object 0x231f520 of type GimpExtension not finalized correctly.
    
    Outputted when glib is built with -Dglib_debug=enabled and GIMP is run
    with GOBJECT_DEBUG=objects.

 app/core/gimpextension.c | 2 ++
 app/core/gimplineart.c   | 4 ++++
 2 files changed, 6 insertions(+)
---
diff --git a/app/core/gimpextension.c b/app/core/gimpextension.c
index 60a80dbf05..7a1892f213 100644
--- a/app/core/gimpextension.c
+++ b/app/core/gimpextension.c
@@ -165,6 +165,8 @@ gimp_extension_finalize (GObject *object)
   g_free (extension->p->path);
   if (extension->p->app)
     g_object_unref (extension->p->app);
+
+  G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 static void
diff --git a/app/core/gimplineart.c b/app/core/gimplineart.c
index 6e34ba583a..970672335a 100644
--- a/app/core/gimplineart.c
+++ b/app/core/gimplineart.c
@@ -306,6 +306,8 @@ static void       gimp_edgelset_next8             (const GeglBuffer  *buffer,
 G_DEFINE_TYPE_WITH_CODE (GimpLineArt, gimp_line_art, GIMP_TYPE_OBJECT,
                          G_ADD_PRIVATE (GimpLineArt))
 
+#define parent_class gimp_line_art_parent_class
+
 static guint gimp_line_art_signals[LAST_SIGNAL] = { 0 };
 
 static void
@@ -382,6 +384,8 @@ gimp_line_art_finalize (GObject *object)
   line_art->priv->frozen = FALSE;
 
   gimp_line_art_set_input (line_art, NULL);
+
+  G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]