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>2022-04-13 11:25:53 +0300
committerBastien Montagne <bastien@blender.org>2022-04-13 11:28:48 +0300
commita63982a65b92a9422c6de350cc0528f2fa345a8b (patch)
treef183214e700d912a23ec83a0253a149b8a340363
parent4a70561bbdc97aa40c5817a573bf3515e3f95769 (diff)
Fix T97289: Linked collection assets disappear.
After appending, new link/append code would delete linked IDs, even if those where pre-existing. Note that this would actually lead to invalid memory access later in append code (ASAN crash).
-rw-r--r--source/blender/blenkernel/intern/blendfile_link_append.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c b/source/blender/blenkernel/intern/blendfile_link_append.c
index be2abdbfb69..da48365a43e 100644
--- a/source/blender/blenkernel/intern/blendfile_link_append.c
+++ b/source/blender/blenkernel/intern/blendfile_link_append.c
@@ -1187,6 +1187,11 @@ void BKE_blendfile_append(BlendfileLinkAppendContext *lapp_context, ReportList *
BLI_assert(ID_IS_LINKED(id));
BLI_assert(id->newid != NULL);
+ /* Do NOT delete a linked data that was already linked before this append. */
+ if (id->tag & LIB_TAG_PRE_EXISTING) {
+ continue;
+ }
+
id->tag |= LIB_TAG_DOIT;
item->new_id = id->newid;
}