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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-09-21 16:01:55 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-09-21 16:06:07 +0300
commitdf80aeb162ac5def465bb87d95abf851f014f616 (patch)
treed063b9042c6608de5e221747d610044cbbf3a21c /source
parent8da3c5c1b9585826209fe3c0cbbead06bda1cfc1 (diff)
Fix (unreported) Append/link code: All library datablocks could end with same name.
This was broken since ages I think, did not really hurt since we usually never use libs' names to access them. Rather bad behavior however, breaking a ground rule of our ID system! And no real reason to add new libraries to new (split) Main at all, libraries are never considered linked datablocks, which means they should always be in 'main' Main->library list. Not a regression, but should be included in 2.76 imho.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/readfile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 55cadaef459..aeb3168c1bc 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -618,7 +618,9 @@ static Main *blo_find_main(FileData *fd, const char *filepath, const char *relab
m = BKE_main_new();
BLI_addtail(mainlist, m);
- lib = BKE_libblock_alloc(m, ID_LI, "lib");
+ /* Add library datablock itself to 'main' Main, since libraries are **never** linked data.
+ * Fixes bug where you could end with all ID_LI datablocks having the same name... */
+ lib = BKE_libblock_alloc(mainlist->first, ID_LI, "Lib");
BLI_strncpy(lib->name, filepath, sizeof(lib->name));
BLI_strncpy(lib->filepath, name1, sizeof(lib->filepath));