1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 20:12:21 +02:00

Reworked !hasRequiredTypes state

This commit is contained in:
Brian Fiete 2021-02-07 06:00:34 -08:00
parent 5f5c752f5d
commit eddbf7a984
11 changed files with 104 additions and 77 deletions

View file

@ -2917,10 +2917,21 @@ void BfContext::Cleanup()
// Clean up deleted BfTypes
// These need to get deleted before the modules because we access mModule in the MethodInstance dtors
for (auto type : mTypeGraveyard)
for (int pass = 0; pass < 2; pass++)
{
BF_ASSERT(type->mRebuildFlags & BfTypeRebuildFlag_Deleted);
delete type;
for (int i = 0; i < (int)mTypeGraveyard.size(); i++)
{
auto type = mTypeGraveyard[i];
if (type == NULL)
continue;
bool deleteNow = (type->IsBoxed() == (pass == 0));
if (!deleteNow)
continue;
BF_ASSERT(type->mRebuildFlags & BfTypeRebuildFlag_Deleted);
delete type;
mTypeGraveyard[i] = NULL;
}
}
mTypeGraveyard.Clear();