mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 15:52:09 +00:00
- added a workaround for a crashing condition in FThinkerIterator.
It can actually happen that the thinker chain gets broken if an actor being iterated happens to destroy the immediately following actor in the chain as well. In that case both actors lose their chain links and the iterator cannot advance any further, the only solution to avoid a crash is to terminate the iteration of the current list.
This commit is contained in:
parent
26170419f4
commit
96788850d3
1 changed files with 3 additions and 0 deletions
|
@ -675,6 +675,9 @@ DThinker *FThinkerIterator::Next (bool exact)
|
||||||
{
|
{
|
||||||
return thinker;
|
return thinker;
|
||||||
}
|
}
|
||||||
|
// This can actually happen when a Destroy call on 'thinker' happens to destroy 'm_CurrThinker'.
|
||||||
|
// In that case there is no chance to recover, we have to terminate the iteration of this list.
|
||||||
|
if (m_CurrThinker == nullptr) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((m_SearchingFresh = !m_SearchingFresh))
|
if ((m_SearchingFresh = !m_SearchingFresh))
|
||||||
|
|
Loading…
Reference in a new issue