mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- fixed GC::FullGC not collecting everything anymore.
With the delayed handling of internal references of destroyed objects the function now returned without making sure that it really got everything. Repeating until it cannot delete anything new anymore makes it work again as intended.
This commit is contained in:
parent
2ed8e6780e
commit
aedf0e3ce5
1 changed files with 23 additions and 17 deletions
|
@ -550,28 +550,34 @@ void Step()
|
|||
|
||||
void FullGC()
|
||||
{
|
||||
if (State <= GCS_Propagate)
|
||||
bool ContinueCheck = true;
|
||||
while (ContinueCheck)
|
||||
{
|
||||
// Reset sweep mark to sweep all elements (returning them to white)
|
||||
SweepPos = &Root;
|
||||
// Reset other collector lists
|
||||
Gray = nullptr;
|
||||
State = GCS_Sweep;
|
||||
}
|
||||
// Finish any pending GC stages
|
||||
while (State != GCS_Pause)
|
||||
{
|
||||
SingleStep();
|
||||
}
|
||||
// Loop until everything that can be destroyed and freed is
|
||||
do
|
||||
{
|
||||
MarkRoot();
|
||||
ContinueCheck = false;
|
||||
if (State <= GCS_Propagate)
|
||||
{
|
||||
// Reset sweep mark to sweep all elements (returning them to white)
|
||||
SweepPos = &Root;
|
||||
// Reset other collector lists
|
||||
Gray = nullptr;
|
||||
State = GCS_Sweep;
|
||||
}
|
||||
// Finish any pending GC stages
|
||||
while (State != GCS_Pause)
|
||||
{
|
||||
SingleStep();
|
||||
}
|
||||
} while (HadToDestroy);
|
||||
// Loop until everything that can be destroyed and freed is
|
||||
do
|
||||
{
|
||||
MarkRoot();
|
||||
while (State != GCS_Pause)
|
||||
{
|
||||
SingleStep();
|
||||
}
|
||||
ContinueCheck |= HadToDestroy;
|
||||
} while (HadToDestroy);
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue