[gimp] Bug 646794 - Get rid of valgrind warnings when changing window mode



commit fe6e0c19134018fbb8c80303c71168809f62e215
Author: Massimo Valentini <mvalentini src gnome org>
Date:   Fri Jun 17 17:52:39 2011 +0200

    Bug 646794 - Get rid of valgrind warnings when changing window mode

 app/gui/gimpuiconfigurer.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/app/gui/gimpuiconfigurer.c b/app/gui/gimpuiconfigurer.c
index 0f2c938..60a1004 100644
--- a/app/gui/gimpuiconfigurer.c
+++ b/app/gui/gimpuiconfigurer.c
@@ -175,6 +175,8 @@ gimp_ui_configurer_move_docks_to_columns (GimpUIConfigurer  *ui_configurer,
 
       dock_window    = GIMP_DOCK_WINDOW (dialog_iter->data);
       dock_container = GIMP_DOCK_CONTAINER (dock_window);
+      g_object_add_weak_pointer (G_OBJECT (dock_window),
+                                 (gpointer) &dock_window);
 
       docks = gimp_dock_container_get_docks (dock_container);
       for (dock_iter = docks; dock_iter; dock_iter = dock_iter->next)
@@ -195,13 +197,13 @@ gimp_ui_configurer_move_docks_to_columns (GimpUIConfigurer  *ui_configurer,
         }
       g_list_free (docks);
 
+      if (dock_window)
+        g_object_remove_weak_pointer (G_OBJECT (dock_window),
+                                      (gpointer) &dock_window);
+
       /* Kill the window if removing the dock didn't destroy it
        * already. This will be the case for the toolbox dock window
        */
-      /* FIXME: We should solve this in a more elegant way, valgrind
-       * complains about invalid reads when the dock window already is
-       * destroyed
-       */
       if (GTK_IS_WIDGET (dock_window))
         {
           guint docks_len;



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