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 <bastien@blender.org>2022-04-29 17:33:48 +0300
committerBastien Montagne <bastien@blender.org>2022-04-29 18:57:46 +0300
commitd779b154853afba9cb2a30826c2c7f30237153e3 (patch)
tree5b7fd7cd64881ff808dafea319b6a1febeee67e0 /source
parentf44a34fc55ba367e201d13cf0a1eddfe13199f8a (diff)
Fix (unreported) bad handling of ID usercount increment in remapping code.
While this only had minor potential effect, both code incrementing usercount of newly remapped IDs were wrong. Original one would by-pass any 'ensured user' handling, newer one would systematically make the ID directly linked... `id_us_plus_no_lib` is to be used here.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/lib_id_remapper.cc3
-rw-r--r--source/blender/blenkernel/intern/lib_remap.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/lib_id_remapper.cc b/source/blender/blenkernel/intern/lib_id_remapper.cc
index 7696386c87d..7e75e0f5d93 100644
--- a/source/blender/blenkernel/intern/lib_id_remapper.cc
+++ b/source/blender/blenkernel/intern/lib_id_remapper.cc
@@ -86,7 +86,8 @@ struct IDRemapper {
}
if (options & ID_REMAP_APPLY_UPDATE_REFCOUNT) {
- id_us_plus(*r_id_ptr);
+ /* Do not handle LIB_TAG_INDIRECT/LIB_TAG_EXTERN here. */
+ id_us_plus_no_lib(*r_id_ptr);
}
if (options & ID_REMAP_APPLY_ENSURE_REAL) {
diff --git a/source/blender/blenkernel/intern/lib_remap.c b/source/blender/blenkernel/intern/lib_remap.c
index 2b449ad50bb..3f40c9d2088 100644
--- a/source/blender/blenkernel/intern/lib_remap.c
+++ b/source/blender/blenkernel/intern/lib_remap.c
@@ -131,8 +131,8 @@ static void foreach_libblock_remap_callback_apply(ID *id_owner,
id_us_min(old_id);
}
if (new_id != NULL && (force_user_refcount || (new_id->tag & LIB_TAG_NO_MAIN) == 0)) {
- /* We do not want to handle LIB_TAG_INDIRECT/LIB_TAG_EXTERN here. */
- new_id->us++;
+ /* Do not handle LIB_TAG_INDIRECT/LIB_TAG_EXTERN here. */
+ id_us_plus_no_lib(new_id);
}
}
else if (cb_flag & IDWALK_CB_USER_ONE) {