[gimp/gimp-2-6] Bug 609026 - leaks shared memory



commit cb41897d21161687c7003d021ddcd4218e57609a
Author: Michael Natterer <mitch gimp org>
Date:   Wed Feb 10 19:37:46 2010 +0100

    Bug 609026 - leaks shared memory
    
    Move calling gimp_plug_in_shm_free() from gimp_plug_in_manager_finalize()
    to gimp_plug_in_manager_exit() so it's also called in stable GIMP
    releases which simply call exit() at some point instead of taking the
    time to shut down everything completely.
    (cherry picked from commit 9a4bf10d30d3ace506caa2196e8f56b369bfab86)

 app/plug-in/gimppluginmanager.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c
index 8f8383a..2b690e9 100644
--- a/app/plug-in/gimppluginmanager.c
+++ b/app/plug-in/gimppluginmanager.c
@@ -201,12 +201,6 @@ gimp_plug_in_manager_finalize (GObject *object)
       manager->plug_in_defs = NULL;
     }
 
-  if (manager->shm)
-    {
-      gimp_plug_in_shm_free (manager->shm);
-      manager->shm = NULL;
-    }
-
   if (manager->environ_table)
     {
       g_object_unref (manager->environ_table);
@@ -324,6 +318,15 @@ gimp_plug_in_manager_exit (GimpPlugInManager *manager)
 
   while (manager->open_plug_ins)
     gimp_plug_in_close (manager->open_plug_ins->data, TRUE);
+
+  /*  need to deatch from shared memory, we can't rely on exit()
+   *  cleaning up behind us (see bug #609026)
+   */
+  if (manager->shm)
+    {
+      gimp_plug_in_shm_free (manager->shm);
+      manager->shm = NULL;
+    }
 }
 
 void



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