[gimp] app: don't leak the list returned by gimp_get_image_windows()



commit fb87cd1c5d39d863a12745684728ab12edf1f0db
Author: Michael Natterer <mitch gimp org>
Date:   Fri Nov 4 01:30:40 2011 +0100

    app: don't leak the list returned by gimp_get_image_windows()

 app/actions/dialogs-actions.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/app/actions/dialogs-actions.c b/app/actions/dialogs-actions.c
index e869e2b..5321e3d 100644
--- a/app/actions/dialogs-actions.c
+++ b/app/actions/dialogs-actions.c
@@ -273,7 +273,6 @@ dialogs_actions_toolbox_exists (Gimp *gimp)
 {
   GimpDialogFactory *factory       = gimp_dialog_factory_get_singleton ();
   GimpSessionInfo   *info          = NULL;
-  GList             *windows       = gimp ? gimp_get_image_windows (gimp) : NULL;
   gboolean           toolbox_found = FALSE;
   GList             *iter;
 
@@ -284,16 +283,20 @@ dialogs_actions_toolbox_exists (Gimp *gimp)
   /* Then in image windows */
   if (! toolbox_found)
     {
+      GList *windows = gimp ? gimp_get_image_windows (gimp) : NULL;
+
       for (iter = windows; iter; iter = g_list_next (iter))
         {
           GimpImageWindow *window = GIMP_IMAGE_WINDOW (windows->data);
-      
+
           if (gimp_image_window_has_toolbox (window))
             {
               toolbox_found = TRUE;
               break;
             }
         }
+
+      g_list_free (windows);
     }
 
   return toolbox_found;



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