diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-09-23 23:35:21 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-09-23 23:35:21 +0400 |
commit | fc2dbc20ff5c9187310e8d51dca99c7be13b84b4 (patch) | |
tree | 691f688fe7047196d382af92f257eb71df7affef /source/blender/editors | |
parent | eaf354e222ec64dc0e258a53107ef1eca9ac341c (diff) |
Fix #36800: closing render window during render crashes, the operator would be
cancelled before the job, causing invalid access to op->reports in the job thread.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 12 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 4 |
2 files changed, 14 insertions, 2 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 */ diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index ebec818bb36..dca1b481334 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -926,13 +926,13 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq /* stop all running jobs, except screen one. currently previews frustrate Render * needed to make so sequencer's rendering doesn't conflict with compositor */ - WM_jobs_kill_type(CTX_wm_manager(C), WM_JOB_TYPE_COMPOSITE); + WM_jobs_kill_type(CTX_wm_manager(C), NULL, WM_JOB_TYPE_COMPOSITE); if ((scene->r.seq_flag & R_SEQ_GL_PREV) == 0) { /* in case of final rendering used for preview, kill all previews, * otherwise threading conflict will happen in rendering module */ - WM_jobs_kill_type(CTX_wm_manager(C), WM_JOB_TYPE_RENDER_PREVIEW); + WM_jobs_kill_type(CTX_wm_manager(C), NULL, WM_JOB_TYPE_RENDER_PREVIEW); } } |