Avoid crash in ~LightsDriver_SystemMessage (#1663)
* Avoid crash in ~LightsDriver_SystemMessage This will avoid a crash caused by the fact LIGHTSMAN is destroyed after the other MAN objects * Rework code path for turning lights off on exit Calls to LightsDriver::reset removed from each driver to avoid any crashes LightsDriver::reset renamed to Rest to match surrounding style Added LightsManager::TurnOffAllLights, called before XXXMAN objects are deleted
This commit is contained in:
committed by
Colby Klein
parent
00c9b5b9d4
commit
23889bd7c8
@@ -286,6 +286,14 @@ void ShutdownGame()
|
||||
if( SOUNDMAN )
|
||||
SOUNDMAN->Shutdown();
|
||||
|
||||
/* Reset all lights to off.
|
||||
* This is done before ~LightsManager as some drivers use SCREENMAN
|
||||
* and similar when setting lights. */
|
||||
if( LIGHTSMAN )
|
||||
{
|
||||
LIGHTSMAN->TurnOffAllLights();
|
||||
}
|
||||
|
||||
SAFE_DELETE( SCREENMAN );
|
||||
SAFE_DELETE( STATSMAN );
|
||||
SAFE_DELETE( MESSAGEMAN );
|
||||
|
||||
Reference in New Issue
Block a user