From 990406e1ff9371a8c896b71171caa876cfdff2f6 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 15 Dec 2020 16:58:30 +0100 Subject: Fix crash when deleting/renaming asset library while it's visible Storing the asset library reference by name wasn't a good idea, I thought it would work with a careful fallback, but it's easier to just use the index instead. So change to using indices, make sure fallback methods work reliable and make sure the file list is updated when asset libraries are removed. I added a new notifier type for the latter, I prefer not using file notifiers in asset-library/preferences code. We have more than enough values for notifiers left. --- source/blender/editors/space_userpref/userpref_ops.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/editors/space_userpref') diff --git a/source/blender/editors/space_userpref/userpref_ops.c b/source/blender/editors/space_userpref/userpref_ops.c index 9cc8cc6ddaa..ee23cde78c2 100644 --- a/source/blender/editors/space_userpref/userpref_ops.c +++ b/source/blender/editors/space_userpref/userpref_ops.c @@ -170,6 +170,8 @@ static int preferences_asset_library_remove_exec(bContext *UNUSED(C), wmOperator if (library) { BKE_preferences_asset_library_remove(&U, library); U.runtime.is_dirty = true; + /* Trigger refresh for the Asset Browser. */ + WM_main_add_notifier(NC_SPACE | ND_SPACE_ASSET_PARAMS, NULL); } return OPERATOR_FINISHED; } -- cgit v1.2.3