diff options
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 0f83316edca..577d8af0caf 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -564,6 +564,17 @@ static int screen_render_modal(bContext *C, wmOperator *op, const wmEvent *event return OPERATOR_PASS_THROUGH; } +static int screen_render_cancel(bContext *C, wmOperator *op) +{ + wmWindowManager *wm = CTX_wm_manager(C); + Scene *scene = (Scene *) op->customdata; + + /* kill on cancel, because job is using op->reports */ + WM_jobs_kill_type(wm, scene, WM_JOB_TYPE_RENDER); + + return OPERATOR_CANCELLED; +} + /* using context, starts job */ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *event) { @@ -732,6 +743,7 @@ void RENDER_OT_render(wmOperatorType *ot) /* api callbacks */ ot->invoke = screen_render_invoke; ot->modal = screen_render_modal; + ot->cancel = screen_render_cancel; ot->exec = screen_render_exec; /*ot->poll = ED_operator_screenactive;*/ /* this isn't needed, causes failer in background mode */ |