diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-02-03 14:53:57 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-02-03 14:53:57 +0300 |
commit | 0cb790ac8e0b19c7c9eed8faa0596a130fb1259c (patch) | |
tree | 31ffa0f6fbed0061aecfc95ac1a1a8dddaa41b48 /source | |
parent | 40903efe8504d1409b920c708d877c308e680699 (diff) |
Bugfix #20586: Selecting "Straight Line" from Grease Pencil crashes in UV image editor
This commit adds a check that should prevent crashes of the kind that were occurring in the report description from happening.
However, I couldn't verify yet whether this really works, since it appears the bug has temporarily disappeared in recent svn. Just in case, I've committed this fix, and we can revert/improve if the bug returns.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 371e73cfb9b..946ebbf9d67 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1456,6 +1456,16 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) } else { /* not painting, so start stroke (this should be mouse-button down) */ + + /* we must check that we're still within the area that we're set up to work from + * otherwise we could crash (see bug #20586) + */ + if (CTX_wm_area(C) != p->sa) { + //printf("\t\t\tGP - wrong area execution abort! \n"); + gpencil_draw_exit(C, op); + return OPERATOR_CANCELLED; + } + //printf("\t\tGP - start stroke \n"); p->status= GP_STATUS_PAINTING; /* no break now, since we should immediately start painting */ |