[Bf-blender-cvs] [24be453] master: Fix (unreported) bad LI_ID usercount when linking a new lib.

Bastien Montagne noreply at git.blender.org
Fri Dec 4 17:24:32 CET 2015


Commit: 24be453938c49cd45d910a8ad0ee144fddd843ee
Author: Bastien Montagne
Date:   Fri Dec 4 17:23:28 2015 +0100
Branches: master
https://developer.blender.org/rB24be453938c49cd45d910a8ad0ee144fddd843ee

Fix (unreported) bad LI_ID usercount when linking a new lib.

Library datablocks shall have a zero user count in Blender currently...

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 8851edf..9bc0e24 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -622,6 +622,7 @@ static Main *blo_find_main(FileData *fd, const char *filepath, const char *relab
 	/* 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");
+	lib->id.us = ID_FAKE_USERS(lib);  /* Important, consistency with main ID reading code from read_libblock(). */
 	BLI_strncpy(lib->name, filepath, sizeof(lib->name));
 	BLI_strncpy(lib->filepath, name1, sizeof(lib->filepath));




More information about the Bf-blender-cvs mailing list