Bugfix [#25620] Grease Pencil: crash when using Ctrl+Z while drawing
authorJoshua Leung <aligorith@gmail.com>
Thu, 13 Jan 2011 22:59:48 +0000 (22:59 +0000)
committerJoshua Leung <aligorith@gmail.com>
Thu, 13 Jan 2011 22:59:48 +0000 (22:59 +0000)
Crazy users! Who on earth would try undoing in the middle of an action
(here the crash occurred while a mouse button was still held)?!

(At least it wouldn't have been possible for those using the DKEY +
mousedrag method of invoking strokes though...)

source/blender/editors/gpencil/gpencil_paint.c

index 63c28939c21c5604a73c0c40785a3e5a9c267a66..3a82274e356eaacb6468796609f58ac038f85e2a 100644 (file)
@@ -1636,6 +1636,13 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event)
                                estate = OPERATOR_RUNNING_MODAL;
                        }
                }
+               /* there shouldn't be any other events, but just in case there are, let's swallow them 
+                * (i.e. to prevent problems with with undo)
+                */
+               else {
+                       /* swallow event to save ourselves trouble */
+                       estate = OPERATOR_RUNNING_MODAL;
+               }
        }
        else if (p->status == GP_STATUS_IDLING) {
                /* standard undo/redo shouldn't be allowed to execute or else it causes crashes, so catch it here */