[gimp/gimp-2-8] Bug 687851 - Gimp crashes on Colors > Desaturate



commit 901f396a5e84505d46de80f2ff69ad4ee42e6204
Author: Michael Natterer <mitch gimp org>
Date:   Wed Nov 7 23:21:13 2012 +0100

    Bug 687851 - Gimp crashes on Colors > Desaturate
    
    Don't install the frame rate limiting draw timeout when resuming a
    draw tool that is not active, so accidential timeout installation from
    whatever tool dispose code can't happen.
    (cherry picked from commit 6a33951aa6f7292b7c652d14052eefd8e61d1365)

 app/tools/gimpdrawtool.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index 9cdce7e..646ba38 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -331,12 +331,18 @@ gimp_draw_tool_resume (GimpDrawTool *draw_tool)
   if (draw_tool->paused_count == 0)
     {
 #ifdef USE_TIMEOUT
-      if (! draw_tool->draw_timeout)
-        draw_tool->draw_timeout =
-          gdk_threads_add_timeout_full (G_PRIORITY_HIGH_IDLE,
-                                        DRAW_TIMEOUT,
-                                        (GSourceFunc) gimp_draw_tool_draw_timeout,
-                                        draw_tool, NULL);
+      /* Don't install the timeout if the draw tool isn't active, so
+       * suspend()/resume() can always be called, and have no side
+       * effect on an inactive tool. See bug #687851.
+       */
+      if (gimp_draw_tool_is_active (draw_tool) && ! draw_tool->draw_timeout)
+        {
+          draw_tool->draw_timeout =
+            gdk_threads_add_timeout_full (G_PRIORITY_HIGH_IDLE,
+                                          DRAW_TIMEOUT,
+                                          (GSourceFunc) gimp_draw_tool_draw_timeout,
+                                          draw_tool, NULL);
+        }
 #endif
 
       /* call draw() anyway, it will do nothing if the timeout is



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