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/makesdna/DNA_space_types.h
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/makesdna/DNA_space_types.h')
-rw-r--r--source/blender/makesdna/DNA_space_types.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index e07f085d356..4161faca386 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -673,12 +673,13 @@ typedef enum eSpaceSeq_OverlayType {
*/
typedef struct FileSelectAssetLibraryUID {
short type;
- char _pad[6];
+ char _pad[2];
/**
- * If showing a custom asset library (#FILE_ASSET_LIBRARY_CUSTOM), this name has to be set to
- * define which. Can be empty otherwise.
+ * If showing a custom asset library (#FILE_ASSET_LIBRARY_CUSTOM), this is the index of the
+ * #bUserAssetLibrary within #UserDef.asset_libraries.
+ * Should be ignored otherwise (but better set to -1 then, for sanity and debugging).
*/
- char custom_library_identifier[64]; /* MAX_NAME */
+ int custom_library_index;
} FileSelectAssetLibraryUID;
/* Config and Input for File Selector */