diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-18 05:44:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-18 05:44:40 +0300 |
commit | a0c8727b34d41e86870677d1966c00c4b2607024 (patch) | |
tree | fb5da2be8fa1b31a0f1faba845cb864bffa15d11 /source | |
parent | faafd4634a7083fdf4c9dee04433559c9e437a04 (diff) |
fix for using freed memory with modal grease pencil draw.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index e7d52ddf301..2f2f9c37bdc 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1606,7 +1606,6 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) if (ELEM4(event->type, RETKEY, PADENTER, ESCKEY, SPACEKEY)) { /* exit() ends the current stroke before cleaning up */ //printf("\t\tGP - end of paint op + end of stroke\n"); - gpencil_draw_exit(C, op); p->status= GP_STATUS_DONE; estate = OPERATOR_FINISHED; } @@ -1629,7 +1628,6 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) } else { //printf("\t\tGP - end of stroke + op\n"); - gpencil_draw_exit(C, op); p->status= GP_STATUS_DONE; estate = OPERATOR_FINISHED; } @@ -1642,7 +1640,6 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) */ if (CTX_wm_area(C) != p->sa) { //printf("\t\t\tGP - wrong area execution abort! \n"); - gpencil_draw_exit(C, op); p->status= GP_STATUS_ERROR; estate = OPERATOR_CANCELLED; } @@ -1656,7 +1653,6 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) gp_paint_initstroke(p, p->paintmode); if (p->status == GP_STATUS_ERROR) { - gpencil_draw_exit(C, op); estate = OPERATOR_CANCELLED; } } @@ -1675,7 +1671,6 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) /* finish painting operation if anything went wrong just now */ if (p->status == GP_STATUS_ERROR) { //printf("\t\t\t\tGP - add error done! \n"); - gpencil_draw_exit(C, op); estate = OPERATOR_CANCELLED; } else { @@ -1717,9 +1712,14 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) switch (estate) { case OPERATOR_FINISHED: /* one last flush before we're done */ + gpencil_draw_exit(C, op); WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX need a nicer one that will work break; + case OPERATOR_CANCELLED: + gpencil_draw_exit(C, op); + break; + case OPERATOR_RUNNING_MODAL|OPERATOR_PASS_THROUGH: /* event doesn't need to be handled */ //printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n", event->type, event->type == MIDDLEMOUSE, event->type==MOUSEMOVE); |