Fix T48412: Blender 2.77a crashes on Undo in some specific multi-level linked libraries cases.
Good old dead-brain stupid error when iterating over a linked list from which you remove some items...
This commit is contained in:
parent
8dec4a0e79
commit
e34ade4eb3
Notes:
blender-bot
2023-02-14 07:53:50 +01:00
Referenced by issue #48412, Blender 2.77a crashes on Undo in some specific multi-level linked libraries cases
|
@ -411,11 +411,12 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
|
|||
/* Even though directly used libs have been already moved to new main, indirect ones have not.
|
||||
* This is a bit annoying, but we have no choice but to keep them all for now - means some now unused
|
||||
* data may remain in memory, but think we'll have to live with it. */
|
||||
Main *libmain;
|
||||
Main *libmain, *libmain_next;
|
||||
Main *newmain = bfd->main;
|
||||
ListBase new_mainlist = {newmain, newmain};
|
||||
|
||||
for (libmain = oldmain->next; libmain; libmain = libmain->next) {
|
||||
for (libmain = oldmain->next; libmain; libmain = libmain_next) {
|
||||
libmain_next = libmain->next;
|
||||
/* Note that LIB_INDIRECT does not work with libraries themselves, so we use non-NULL parent
|
||||
* to detect indirect-linked ones... */
|
||||
if (libmain->curlib && (libmain->curlib->parent != NULL)) {
|
||||
|
|
Loading…
Reference in New Issue