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
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-06-15 16:02:32 +0300
committerBastien Montagne <bastien@blender.org>2020-06-15 16:03:53 +0300
commiteadbdf170aeccba498fd9c0e7ef879f2a9f71bd0 (patch)
tree4c8606f66617e0573fe05f2397eca42c3bd812d8 /source/blender/windowmanager/intern/wm_files_link.c
parentcf42721fe28f7fb4c5419ff7a51cba72e986f491 (diff)
Fix T77853: Error reloading linked library.
Issue related to how ID refcounting was changed when loading blendfile data...
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files_link.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index da4e4160724..3ffd6c4a334 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -759,6 +759,10 @@ static void lib_relocate_do(Main *bmain,
BLI_addtail(which_libbase(bmain, GS(old_id->name)), old_id);
}
+ /* Since our (old) reloaded IDs were removed from main, the user count done for them in linking
+ * code is wrong, we need to redo it here after adding them back to main. */
+ BKE_main_id_refcount_recompute(bmain, false);
+
/* Note that in reload case, we also want to replace indirect usages. */
const short remap_flags = ID_REMAP_SKIP_NEVER_NULL_USAGE |
ID_REMAP_NO_INDIRECT_PROXY_DATA_USAGE |