Fix asset list not stopping read job when clearing

Operators may want to refresh the visible list of assets (e.g. when an asset is
added), which wouldn't work correctly when the asset list was already loading
in a background thread.

Part of the brush assets project, see:
- https://projects.blender.org/blender/blender/issues/116337
- https://projects.blender.org/blender/blender/pulls/106303
This commit is contained in:
Bastien Montagne
2024-07-07 18:39:01 +02:00
committed by Julian Eisel
parent 56387f5be5
commit 1ae0bc8e9e

View File

@@ -272,6 +272,7 @@ void AssetList::clear(const bContext *C)
filelist_readjob_stop(files, CTX_wm_manager(C));
filelist_freelib(files);
filelist_clear(files);
filelist_tag_force_reset(files);
WM_main_add_notifier(NC_ASSET | ND_ASSET_LIST, nullptr);
}