[gimp] Bug 643587 - Opening two xcf with vectors crashes gimp



commit ebe4b4102f734c8f0e256c62a0b91103da490ca5
Author: Michael Natterer <mitch gimp org>
Date:   Tue Mar 1 17:05:58 2011 +0100

    Bug 643587 - Opening two xcf with vectors crashes gimp
    
    Fix the crash and the warning pointed out in the bug.

 app/display/gimpcanvaspath.c            |    2 +-
 app/display/gimpdisplayshell-handlers.c |   14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/app/display/gimpcanvaspath.c b/app/display/gimpcanvaspath.c
index 3a35759..349db93 100644
--- a/app/display/gimpcanvaspath.c
+++ b/app/display/gimpcanvaspath.c
@@ -224,7 +224,7 @@ gimp_canvas_path_get_extents (GimpCanvasItem   *item,
 {
   GimpCanvasPathPrivate *private = GET_PRIVATE (item);
 
-  if (private->path)
+  if (private->path && gtk_widget_get_realized (shell->canvas))
     {
       cairo_t      *cr;
       GdkRectangle  rectangle;
diff --git a/app/display/gimpdisplayshell-handlers.c b/app/display/gimpdisplayshell-handlers.c
index 60d9ef2..44dea35 100644
--- a/app/display/gimpdisplayshell-handlers.c
+++ b/app/display/gimpdisplayshell-handlers.c
@@ -673,9 +673,10 @@ gimp_display_shell_sample_point_add_handler (GimpImage        *image,
 
       item = gimp_canvas_proxy_group_get_item (group, sample_point);
 
-      g_object_set (item,
-                    "index", i,
-                    NULL);
+      if (item)
+        g_object_set (item,
+                      "index", i,
+                      NULL);
     }
 }
 
@@ -699,9 +700,10 @@ gimp_display_shell_sample_point_remove_handler (GimpImage        *image,
 
       item = gimp_canvas_proxy_group_get_item (group, sample_point);
 
-      g_object_set (item,
-                    "index", i,
-                    NULL);
+      if (item)
+        g_object_set (item,
+                      "index", i,
+                      NULL);
     }
 }
 



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