Fix potential destruction crashes (#5095)
* Fix potential destruction crashes * Fix destructors accessing destroyted objects * Fix cPlayer not destroying windows (Destroyed never called) * Tentatively fixes #4608, fixes #3236, fixes #3262 - Remove cEntity::Destroyed() and replace with cEntity::OnRemoveFromWorld() * Add missing call to OnRemoveFromWorld
This commit is contained in:
@@ -280,10 +280,9 @@ cPlayer::~cPlayer(void)
|
||||
|
||||
|
||||
|
||||
void cPlayer::Destroyed()
|
||||
void cPlayer::OnRemoveFromWorld(cWorld & a_World)
|
||||
{
|
||||
CloseWindow(false);
|
||||
Super::Destroyed();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user