Fix T47482: Own mistake in new handling of 'userone' ID usages when decrementing usercount.

Ended up not handling at all 'userone' case, now it increments usercount correctly when needed.
This commit is contained in:
Bastien Montagne 2016-02-20 16:47:43 +01:00
parent c0d43871e0
commit 4dd406c7b7
Notes: blender-bot 2023-02-14 08:12:24 +01:00
Referenced by issue #47482, Object linked to scene, is not updated correctly in GroupInstance (objects with face users)
1 changed files with 5 additions and 5 deletions

View File

@ -209,11 +209,6 @@ void id_us_min(ID *id)
if (id) {
const int limit = ID_FAKE_USERS(id);
if ((id->us == limit) && (id->tag & LIB_TAG_EXTRAUSER) && !(id->tag & LIB_TAG_EXTRAUSER_SET)) {
/* We need an extra user here, but never actually incremented user count for it so far, do it now. */
id_us_ensure_real(id);
}
if (id->us <= limit) {
printf("ID user decrement error: %s (from '%s'): %d <= %d\n",
id->name, id->lib ? id->lib->filepath : "[Main]", id->us, limit);
@ -225,6 +220,11 @@ void id_us_min(ID *id)
else {
id->us--;
}
if ((id->us == limit) && (id->tag & LIB_TAG_EXTRAUSER)) {
/* We need an extra user here, but never actually incremented user count for it so far, do it now. */
id_us_ensure_real(id);
}
}
}