[gimp] Bug 616342 - gimp crashes on startup if you have a contextrc file from 2.6



commit 2f5d2bc85f7316b58d8c8227d6360e77acba4c02
Author: Michael Natterer <mitch gimp org>
Date:   Thu Apr 22 16:45:44 2010 +0200

    Bug 616342 - gimp crashes on startup if you have a contextrc file from 2.6
    
    Remove the draw timeout in GObject::dispose() to be safe.

 app/tools/gimpdrawtool.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index d79de5d..b3287a3 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -46,6 +46,8 @@
 #define USE_TIMEOUT  1
 
 
+static void          gimp_draw_tool_dispose      (GObject        *object);
+
 static gboolean      gimp_draw_tool_has_display  (GimpTool       *tool,
                                                   GimpDisplay    *display);
 static GimpDisplay * gimp_draw_tool_has_image    (GimpTool       *tool,
@@ -83,7 +85,10 @@ G_DEFINE_TYPE (GimpDrawTool, gimp_draw_tool, GIMP_TYPE_TOOL)
 static void
 gimp_draw_tool_class_init (GimpDrawToolClass *klass)
 {
-  GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
+  GObjectClass  *object_class = G_OBJECT_CLASS (klass);
+  GimpToolClass *tool_class   = GIMP_TOOL_CLASS (klass);
+
+  object_class->dispose   = gimp_draw_tool_dispose;
 
   tool_class->has_display = gimp_draw_tool_has_display;
   tool_class->has_image   = gimp_draw_tool_has_image;
@@ -101,6 +106,20 @@ gimp_draw_tool_init (GimpDrawTool *draw_tool)
   draw_tool->is_drawn     = FALSE;
 }
 
+static void
+gimp_draw_tool_dispose (GObject *object)
+{
+  GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (object);
+
+  if (draw_tool->draw_timeout)
+    {
+      g_source_remove (draw_tool->draw_timeout);
+      draw_tool->draw_timeout = 0;
+    }
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
 static gboolean
 gimp_draw_tool_has_display (GimpTool    *tool,
                             GimpDisplay *display)



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