mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-19 07:31:03 +00:00
- SW: clear some pointers before killing actors in TerminateLevel.
KillActor is an in-game function which may produce undefined behavior if being run on a partially deinitialized level. All actor pointers it may operate upon should be cleared before taking down the actors.cpp
This commit is contained in:
parent
3b833029b0
commit
2ac83b733c
2 changed files with 7 additions and 1 deletions
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// the Free Software Foundation, either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
|
|
|
@ -533,6 +533,12 @@ void TerminateLevel(void)
|
|||
// Kill User memory and delete sprites
|
||||
SWSpriteIterator it;
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
actor->user.targetActor = nullptr;
|
||||
actor->user.flameActor = nullptr;
|
||||
}
|
||||
it.Reset();
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
KillActor(actor);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue