Fix T55581: kill running (render) jobs when deleting a scene

also fixed passing WM_JOB_TYPE_ANY to WM_jobs_kill_type()

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3498
This commit is contained in:
2018-06-22 13:44:12 +02:00
parent df30b50f2f
commit 3cc2a9b934
2 changed files with 5 additions and 1 deletions

View File

@@ -1447,6 +1447,10 @@ bool ED_screen_delete_scene(bContext *C, Scene *scene)
Main *bmain = CTX_data_main(C);
Scene *newscene;
// kill running jobs
wmWindowManager *wm = CTX_wm_manager(C);
WM_jobs_kill_type(wm, scene, WM_JOB_TYPE_ANY);
if (scene->id.prev)
newscene = scene->id.prev;
else if (scene->id.next)

View File

@@ -500,7 +500,7 @@ void WM_jobs_kill_type(struct wmWindowManager *wm, void *owner, int job_type)
next_job = wm_job->next;
if (!owner || wm_job->owner == owner)
if (wm_job->job_type == job_type)
if (job_type == WM_JOB_TYPE_ANY || wm_job->job_type == job_type)
wm_jobs_kill_job(wm, wm_job);
}
}