mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 00:42:08 +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
f163c328d4
commit
ff8863833a
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