From 06d48367fae6e29426d889081acbe95de0ab663d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 27 May 2021 10:47:02 +0200 Subject: [PATCH] Fix (studio-reported) infinite loop in resync code. Very stupid mistake in libraries indirect-level building code, was not skipping 'loop-back' ID pointers. Note that we also need some level of checks for the case where there would be an actual dependency loop between libraries, this is not supposed to be possible, but better be safe than sorry. Will add in next commit. --- source/blender/blenkernel/intern/lib_override.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 1aa94f82eb3..e16a9081b35 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -1279,6 +1279,9 @@ bool BKE_lib_override_library_resync(Main *bmain, static int lib_override_sort_libraries_func(LibraryIDLinkCallbackData *cb_data) { + if (cb_data->cb_flag & IDWALK_CB_LOOPBACK) { + return IDWALK_RET_NOP; + } ID *id_owner = cb_data->id_owner; ID *id = *cb_data->id_pointer; if (id != NULL && ID_IS_LINKED(id) && id->lib != id_owner->lib) {