Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-12-15 18:58:30 +0300
committerJulian Eisel <julian@blender.org>2020-12-15 19:03:49 +0300
commit990406e1ff9371a8c896b71171caa876cfdff2f6 (patch)
treedc726d606be0df6c549bb63a09484e473b3dd2d9 /source/blender/editors/space_userpref
parent7dc8db7cd135e7b26fccc1cc6728cac8b510de70 (diff)
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.
Diffstat (limited to 'source/blender/editors/space_userpref')
-rw-r--r--source/blender/editors/space_userpref/userpref_ops.c2
1 files changed, 2 insertions, 0 deletions
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;
}