[gimp] app: free Gimp members in reverse order of creation



commit f1897b655eeec82307e0fe745d3a85d352b7c7a5
Author: Michael Natterer <mitch gimp org>
Date:   Tue Sep 13 12:44:10 2016 +0200

    app: free Gimp members in reverse order of creation

 app/core/gimp.c |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)
---
diff --git a/app/core/gimp.c b/app/core/gimp.c
index 3266c51..61fb1d5 100644
--- a/app/core/gimp.c
+++ b/app/core/gimp.c
@@ -341,6 +341,26 @@ gimp_dispose (GObject *object)
 
   gimp_filter_history_clear (gimp);
 
+  if (gimp->edit_config)
+    {
+      g_object_unref (gimp->edit_config);
+      gimp->edit_config = NULL;
+    }
+
+  if (gimp->config)
+    {
+      g_object_unref (gimp->config);
+      gimp->config = NULL;
+    }
+
+  gimp_contexts_exit (gimp);
+
+  if (gimp->image_new_last_template)
+    {
+      g_object_unref (gimp->image_new_last_template);
+      gimp->image_new_last_template = NULL;
+    }
+
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
@@ -366,14 +386,6 @@ gimp_finalize (GObject *object)
   standards = g_list_prepend (standards,
                               gimp_palette_get_standard (gimp->user_context));
 
-  gimp_contexts_exit (gimp);
-
-  if (gimp->image_new_last_template)
-    {
-      g_object_unref (gimp->image_new_last_template);
-      gimp->image_new_last_template = NULL;
-    }
-
   if (gimp->templates)
     {
       g_object_unref (gimp->templates);
@@ -461,12 +473,6 @@ gimp_finalize (GObject *object)
       gimp->parasites = NULL;
     }
 
-  if (gimp->edit_config)
-    {
-      g_object_unref (gimp->edit_config);
-      gimp->edit_config = NULL;
-    }
-
   if (gimp->default_folder)
     {
       g_object_unref (gimp->default_folder);


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