[Bf-blender-cvs] [cd833d88799] blender-v2.83-release: Readfile: debug check all IDs are properly linked at the end.

Bastien Montagne noreply at git.blender.org
Wed Apr 29 21:37:49 CEST 2020


Commit: cd833d887995d210b5998bd7d17c59cbb8fe0cba
Author: Bastien Montagne
Date:   Wed Apr 29 21:35:13 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBcd833d887995d210b5998bd7d17c59cbb8fe0cba

Readfile: debug check all IDs are properly linked at the end.

Should prevent issue fixed by previous commit to happen again (since
read code, especially in undo case, is not really straight forward to
follow anymore).

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 98e6369b634..cb567147224 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -10137,6 +10137,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
 }
 
 /** \} */



More information about the Bf-blender-cvs mailing list