forked from Mirrors/openclonk
Do not hang when a C4Value with prop list pointer is not cleared at game end.
Just cause an assertion in debug mode instead.lights3
parent
7813d87338
commit
3886f76bf3
|
@ -213,6 +213,7 @@ void C4PropListScript::ClearScriptPropLists()
|
|||
C4PropListScript *const* p_next, *const* p;
|
||||
while ((p_next = PropLists.First()))
|
||||
{
|
||||
size_t prev_size = PropLists.GetSize();
|
||||
while ((p = p_next))
|
||||
{
|
||||
p_next = PropLists.Next(p);
|
||||
|
@ -223,6 +224,16 @@ void C4PropListScript::ClearScriptPropLists()
|
|||
(*p)->Clear();
|
||||
}
|
||||
}
|
||||
if (PropLists.GetSize() >= prev_size)
|
||||
{
|
||||
// Looks like there's a rogue C4Value pointer somewhere.
|
||||
// Could just delete the prop list and let ref counting do the job
|
||||
// However, it might be better to keep the dead pointer to find the leak in debug mode
|
||||
#ifdef _DEBUG
|
||||
assert(0);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue