Fix T62098: Outliner: Delete hierarchy crash.

Stupid mistake in own logic would prevent first deleted ID to be
properly unlinked from rest of .blend file before its deletion...
This commit is contained in:
Bastien Montagne 2019-03-01 23:02:25 +01:00
parent e0458a3ead
commit ccecc409e4
Notes: blender-bot 2023-02-14 07:39:44 +01:00
Referenced by issue #62098, Outliner: Delete hierarchy crash
1 changed files with 3 additions and 5 deletions

View File

@ -956,6 +956,7 @@ static void id_delete(Main *bmain, const bool do_tagged_deletion)
{
const int tag = LIB_TAG_DOIT;
ListBase *lbarray[MAX_LIBARRAY];
Link dummy_link = {0};
int base_count, i;
/* Used by batch tagged deletion, when we call BKE_id_free then, id is no more in Main database,
@ -1000,11 +1001,8 @@ static void id_delete(Main *bmain, const bool do_tagged_deletion)
}
}
if (last_remapped_id == NULL) {
last_remapped_id = tagged_deleted_ids.first;
if (last_remapped_id == NULL) {
BLI_assert(!keep_looping);
break;
}
dummy_link.next = tagged_deleted_ids.first;
last_remapped_id = (ID *)(&dummy_link);
}
for (id = last_remapped_id->next; id; id = id->next) {
/* Will tag 'never NULL' users of this ID too.