mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix failing test after own recent commit regarding Main freeing function.
3e5ce23c99introduced a regression in case the freed Main was part of a list, and was supposed to be removed from it, since calling `BLI_remlink` does _not_ clear the `prev`/`next` pointers of the removed link. This commit also contains a few more tweaks to recent relatedb3f42d8e98commit. Pull Request #105497
This commit is contained in:
parent
ade069e23a
commit
a13960c8a2
1 changed files with 7 additions and 4 deletions
|
|
@ -469,11 +469,9 @@ void blo_join_main(ListBase *mainlist)
|
|||
|
||||
mainl = mainlist->first;
|
||||
while ((tojoin = mainl->next)) {
|
||||
if (tojoin->is_read_invalid) {
|
||||
mainl->is_read_invalid = true;
|
||||
}
|
||||
add_main_to_main(mainl, tojoin);
|
||||
BLI_remlink(mainlist, tojoin);
|
||||
tojoin->next = tojoin->prev = NULL;
|
||||
BKE_main_free(tojoin);
|
||||
}
|
||||
}
|
||||
|
|
@ -5273,7 +5271,7 @@ static void library_link_end(Main *mainl,
|
|||
add_main_to_main(mainvar, main_newid);
|
||||
|
||||
if (mainvar->is_read_invalid) {
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5282,6 +5280,11 @@ static void library_link_end(Main *mainl,
|
|||
mainvar = (*fd)->mainlist->first;
|
||||
MEM_freeN((*fd)->mainlist);
|
||||
|
||||
if (mainvar->is_read_invalid) {
|
||||
BKE_main_free(main_newid);
|
||||
return;
|
||||
}
|
||||
|
||||
/* This does not take into account old, deprecated data, so we also have to do it after
|
||||
* `do_versions_after_linking()`. */
|
||||
BKE_main_id_refcount_recompute(mainvar, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue