mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
- to avoid problems with the final garbage collection, the players' PendingWeapon needs to be cleared manually.
This is because it can point to a non-standard value which the garbage collector cannot deal with during engine shutdown.
This commit is contained in:
parent
4e685f2b78
commit
ccecfeb45c
1 changed files with 7 additions and 0 deletions
|
@ -2817,6 +2817,13 @@ void PClass::StaticShutdown ()
|
||||||
// This flags DObject::Destroy not to call any scripted OnDestroy methods anymore.
|
// This flags DObject::Destroy not to call any scripted OnDestroy methods anymore.
|
||||||
bVMOperational = false;
|
bVMOperational = false;
|
||||||
|
|
||||||
|
// PendingWeapon must be cleared manually because it is not subjected to the GC if it contains WP_NOCHANGE, which is just RUNTIME_CLASS(AWWeapon).
|
||||||
|
// But that will get cleared here, confusing the GC if the value is left in.
|
||||||
|
for (auto &p : players)
|
||||||
|
{
|
||||||
|
p.PendingWeapon = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
// Unless something went wrong, anything left here should be class and type objects only, which do not own any scripts.
|
// Unless something went wrong, anything left here should be class and type objects only, which do not own any scripts.
|
||||||
bShutdown = true;
|
bShutdown = true;
|
||||||
TypeTable.Clear();
|
TypeTable.Clear();
|
||||||
|
|
Loading…
Reference in a new issue