forked from bartvdbraak/blender
Fix T57816: Crash when deleting recently orphaned collection
We were never removing the parent collection from a collection upon removal of the parent. Reviewers: mont29 Differential Revision: https://developer.blender.org/D4099
This commit is contained in:
parent
8cbadde1a5
commit
36184f7392
@ -683,8 +683,9 @@ static void collection_missing_parents_remove(Collection *collection)
|
|||||||
{
|
{
|
||||||
for (CollectionParent *parent = collection->parents.first, *parent_next; parent != NULL; parent = parent_next) {
|
for (CollectionParent *parent = collection->parents.first, *parent_next; parent != NULL; parent = parent_next) {
|
||||||
parent_next = parent->next;
|
parent_next = parent->next;
|
||||||
|
if ((parent->collection == NULL) ||
|
||||||
if (!collection_find_child(parent->collection, collection)) {
|
!collection_find_child(parent->collection, collection))
|
||||||
|
{
|
||||||
BLI_freelinkN(&collection->parents, parent);
|
BLI_freelinkN(&collection->parents, parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -747,6 +747,9 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
|
|||||||
for (CollectionChild *child = collection->children.first; child; child = child->next) {
|
for (CollectionChild *child = collection->children.first; child; child = child->next) {
|
||||||
CALLBACK_INVOKE(child->collection, IDWALK_CB_USER);
|
CALLBACK_INVOKE(child->collection, IDWALK_CB_USER);
|
||||||
}
|
}
|
||||||
|
for (CollectionParent *parent = collection->parents.first; parent; parent = parent->next) {
|
||||||
|
CALLBACK_INVOKE(parent->collection, IDWALK_CB_NOP);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user