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:
@@ -1447,6 +1447,10 @@ bool ED_screen_delete_scene(bContext *C, Scene *scene)
|
|||||||
Main *bmain = CTX_data_main(C);
|
Main *bmain = CTX_data_main(C);
|
||||||
Scene *newscene;
|
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)
|
if (scene->id.prev)
|
||||||
newscene = scene->id.prev;
|
newscene = scene->id.prev;
|
||||||
else if (scene->id.next)
|
else if (scene->id.next)
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ void WM_jobs_kill_type(struct wmWindowManager *wm, void *owner, int job_type)
|
|||||||
next_job = wm_job->next;
|
next_job = wm_job->next;
|
||||||
|
|
||||||
if (!owner || wm_job->owner == owner)
|
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);
|
wm_jobs_kill_job(wm, wm_job);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user