diff options
author | Bastien Montagne <bastien@blender.org> | 2020-04-29 22:38:18 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-04-29 22:38:18 +0300 |
commit | 00e0034b13e6a8d88fbdb1a6b2b86d99a9b5a69b (patch) | |
tree | 4292f9c8792acdf54307a6a00562930f2cba4705 /source/blender/blenloader/intern | |
parent | d07dab0d612614998a40e543a19b1f755a8f12a4 (diff) | |
parent | cd833d887995d210b5998bd7d17c59cbb8fe0cba (diff) |
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ac1d315434d..c8428ac7fb3 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9715,7 +9715,9 @@ static bool read_libblock_undo_restore( /* Do not add LIB_TAG_NEW here, this should not be needed/used in undo case anyway (as * this is only for do_version-like code), but for sake of consistency, and also because * it will tell us which ID is re-used from old Main, and which one is actually new. */ - const int id_tag = tag | LIB_TAG_NEED_LINK | LIB_TAG_UNDO_OLD_ID_REUSED; + /* Also do not add LIB_TAG_NEED_LINK, those IDs will never be re-liblinked, hence that tag will + * never be cleared, leading to critical issue in link/appemd code. */ + const int id_tag = tag | LIB_TAG_UNDO_OLD_ID_REUSED; read_libblock_undo_restore_identical(fd, main, id, id_old, id_tag); /* Insert into library map for lookup by newly read datablocks (with pointer value bhead->old). @@ -10195,6 +10197,15 @@ static void lib_link_all(FileData *fd, Main *bmain) * 'permanently' in our data structures... */ BKE_main_collections_parent_relations_rebuild(bmain); } + +#ifndef NDEBUG + /* Double check we do not have any 'need link' tag remaining, this should never be the case once + * this function has run. */ + FOREACH_MAIN_ID_BEGIN (bmain, id) { + BLI_assert((id->tag & LIB_TAG_NEED_LINK) == 0); + } + FOREACH_MAIN_ID_END; +#endif } /** \} */ |