[gimp] app: Move g_list_copy() out from gimp_dock_columns_get_docks()



commit 13bac610202276ad0595f7be54d3391034f15a74
Author: Martin Nordholts <martinn src gnome org>
Date:   Sun Nov 15 19:21:57 2009 +0100

    app: Move g_list_copy() out from gimp_dock_columns_get_docks()
    
    Move g_list_copy() out from gimp_dock_columns_get_docks(). Fixes at
    least one memory leak (in gimp_dock_window_get_dock()) and feels nicer
    and more flexible.

 app/gui/gimpuiconfigurer.c    |    4 ++--
 app/widgets/gimpdockcolumns.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/app/gui/gimpuiconfigurer.c b/app/gui/gimpuiconfigurer.c
index 4851fb2..4ce2308 100644
--- a/app/gui/gimpuiconfigurer.c
+++ b/app/gui/gimpuiconfigurer.c
@@ -171,7 +171,7 @@ gimp_ui_configurer_move_docks_to_columns (GimpUIConfigurer  *ui_configurer,
 
       dock_window = GIMP_DOCK_WINDOW (dialog_iter->data);
 
-      docks = gimp_dock_window_get_docks (dock_window);
+      docks = g_list_copy (gimp_dock_window_get_docks (dock_window));
       for (dock_iter = docks; dock_iter; dock_iter = dock_iter->next)
         {
           GimpDock *dock = GIMP_DOCK (dock_iter->data);
@@ -252,7 +252,7 @@ gimp_ui_configurer_move_docks_to_window (GimpUIConfigurer *ui_configurer,
                                          GimpDockColumns  *dock_columns)
 {
   GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (dock_columns));
-  GList     *docks  = gimp_dock_columns_get_docks (dock_columns);
+  GList     *docks  = g_list_copy (gimp_dock_columns_get_docks (dock_columns));
   GList     *iter   = NULL;
 
   for (iter = docks; iter; iter = iter->next)
diff --git a/app/widgets/gimpdockcolumns.c b/app/widgets/gimpdockcolumns.c
index e1bae0e..ccd2937 100644
--- a/app/widgets/gimpdockcolumns.c
+++ b/app/widgets/gimpdockcolumns.c
@@ -236,5 +236,5 @@ gimp_dock_columns_remove_dock (GimpDockColumns *dock_columns,
 GList *
 gimp_dock_columns_get_docks (GimpDockColumns *dock_columns)
 {
-  return g_list_copy (dock_columns->p->docks);
+  return dock_columns->p->docks;
 }



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