diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-14 17:05:52 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-14 17:05:52 +0300 |
commit | 00166ff62e689b7caebdd3a0c4f9051b2739826a (patch) | |
tree | 7daed8f9b67b1d4b5c3597997b335b9ad6ef484f /source/blender/makesdna | |
parent | 6b1d77a8052b0706ef2277cb1a5e4f3c67310806 (diff) |
Better fix for T47787 - remove extra user due to 'user_one' as soon as we increase 'real' user count.
This has several benefits:
* User count remains coherent, regardless of the order in which you use 'user_one' & real refcounting users
(i.e. if you add to group, and then link in scene, or the reverse, you now always get same final user count).
* Avoids the need to check for potential 'user_one' extra user in count in several places in code (e.g. when
making IDs single users...).
* Users won't wonder why they cannot make 'single user' and ID even though its user count shows '2'!
* readfile.c now always uses code from BKE's library.c when modifying id->us. Which means we can consider
(asside from assignment during initialization) that id->us is read-only outside of library.c context.
Note that this commit reverts previous one (rB6b1d77a8052b) - please **do not** backport this one in 2.77.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index eff68521b76..0bf3c350263 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -260,7 +260,6 @@ typedef struct PreviewImage { #define ID_FAKE_USERS(id) ((((ID *)id)->flag & LIB_FAKEUSER) ? 1 : 0) #define ID_REAL_USERS(id) (((ID *)id)->us - ID_FAKE_USERS(id)) -#define ID_REFCOUNT_USERS(id) (((ID *)id)->us - ((((ID *)id)->tag & LIB_TAG_EXTRAUSER_SET) ? 1 : 0) - ID_FAKE_USERS(id)) #define ID_CHECK_UNDO(id) ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM)) |