Fix #160525: Potential crash when switching editors quickly

Even though `filelist_readjob_stop()` was called to stop the read-job
which also had code to cancel the job's timer, the timer callback would
still be executed. The timer cancelling also handles pending timer
events and timer handling correctly skipped cancelled timers. So it
should all work.

But I think when switching from the file browser to the asset browser,
the effective job-type would change (the value returned by
`filelist_jobtype_get()`), so we wouldn't find the correct job to cancel
using the job type as part of the key. Just stick to the owner pointer
as key for the job to cancel.

Pull Request: https://projects.blender.org/blender/blender/pulls/160878
This commit is contained in:
Julian Eisel 2026-07-01 10:03:51 +02:00 • committed by Julian Eisel
parent 98a55f3a54
commit ffe2abc38b

View file

@ -269,7 +269,7 @@ void filelist_readjob_blocking_run(FileList *filelist, int space_notifier, const
void filelist_readjob_stop(FileList *filelist, wmWindowManager *wm)
{
WM_jobs_kill_type(wm, filelist, filelist_jobtype_get(filelist));
WM_jobs_kill_all_from_owner(wm, filelist);
}
int filelist_readjob_running(FileList *filelist, wmWindowManager *wm)