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:
Gareth Francis
2018-05-10 18:04:44 -07:00
committed by Colby Klein
parent 00c9b5b9d4
commit 23889bd7c8
11 changed files with 23 additions and 9 deletions
+6
View File
@@ -512,6 +512,12 @@ bool LightsManager::IsEnabled() const
return m_vpDrivers.size() >= 1 || PREFSMAN->m_bDebugLights;
}
void LightsManager::TurnOffAllLights()
{
FOREACH( LightsDriver*, m_vpDrivers, iter )
(*iter)->Reset();
}
/*
* (c) 2003-2004 Chris Danford
* All rights reserved.