[gimp] app: allow to call gimp_image_map_tool_dialog_hide() multiple times



commit 8230e948a851385602f5e3ead64745b2c1c31a99
Author: Michael Natterer <mitch gimp org>
Date:   Thu Apr 25 22:23:32 2013 +0200

    app: allow to call gimp_image_map_tool_dialog_hide() multiple times
    
    don't try to remove a GimpOverlayDialog from the canvas twice.

 app/tools/gimpimagemaptool.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/app/tools/gimpimagemaptool.c b/app/tools/gimpimagemaptool.c
index 51690f9..be0af1b 100644
--- a/app/tools/gimpimagemaptool.c
+++ b/app/tools/gimpimagemaptool.c
@@ -733,9 +733,12 @@ gimp_image_map_tool_dialog_hide (GimpImageMapTool *image_map_tool)
     }
   else if (GIMP_IS_OVERLAY_DIALOG (dialog))
     {
-      g_object_ref (dialog);
-      gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (dialog)),
-                            dialog);
+      if (gtk_widget_get_parent (dialog))
+        {
+          g_object_ref (dialog);
+          gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (dialog)),
+                                dialog);
+        }
     }
 }
 


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