clear GroundLightManager also on non-standard exits to avoid crash
(e.g. --show-aircraft, https://sourceforge.net/p/flightgear/codetickets/1935/ )
This commit is contained in:
parent
d343496084
commit
2b1336cd39
2 changed files with 5 additions and 4 deletions
src/Main
|
@ -54,6 +54,7 @@
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
#include <simgear/structure/exception.hxx>
|
#include <simgear/structure/exception.hxx>
|
||||||
|
#include <simgear/scene/tgdb/GroundLightManager.hxx>
|
||||||
|
|
||||||
#include <osg/Texture>
|
#include <osg/Texture>
|
||||||
#include <osg/BufferObject>
|
#include <osg/BufferObject>
|
||||||
|
@ -310,6 +311,10 @@ void fgExitCleanup() {
|
||||||
// on the common exit path globals is already deleted, and NULL,
|
// on the common exit path globals is already deleted, and NULL,
|
||||||
// so this only happens on error paths.
|
// so this only happens on error paths.
|
||||||
delete globals;
|
delete globals;
|
||||||
|
// avoid crash on exit (https://sourceforge.net/p/flightgear/codetickets/1935/)
|
||||||
|
simgear::GroundLightManager::instance()->getRunwayLightStateSet()->clear();
|
||||||
|
simgear::GroundLightManager::instance()->getTaxiLightStateSet()->clear();
|
||||||
|
simgear::GroundLightManager::instance()->getGroundLightStateSet()->clear();
|
||||||
|
|
||||||
simgear::shutdownLogging();
|
simgear::shutdownLogging();
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,6 @@ extern bool global_crashRptEnabled;
|
||||||
#include <simgear/math/SGMath.hxx>
|
#include <simgear/math/SGMath.hxx>
|
||||||
#include <simgear/math/sg_random.h>
|
#include <simgear/math/sg_random.h>
|
||||||
#include <simgear/misc/strutils.hxx>
|
#include <simgear/misc/strutils.hxx>
|
||||||
#include <simgear/scene/tgdb/GroundLightManager.hxx>
|
|
||||||
|
|
||||||
#include <Model/panelnode.hxx>
|
#include <Model/panelnode.hxx>
|
||||||
#include <Scenery/scenery.hxx>
|
#include <Scenery/scenery.hxx>
|
||||||
|
@ -555,9 +554,6 @@ int fgMainInit( int argc, char **argv )
|
||||||
// delete the NavCache here. This will cause the destruction of many cached
|
// delete the NavCache here. This will cause the destruction of many cached
|
||||||
// objects (eg, airports, navaids, runways).
|
// objects (eg, airports, navaids, runways).
|
||||||
delete flightgear::NavDataCache::instance();
|
delete flightgear::NavDataCache::instance();
|
||||||
simgear::GroundLightManager::instance()->getRunwayLightStateSet()->clear();
|
|
||||||
simgear::GroundLightManager::instance()->getTaxiLightStateSet()->clear();
|
|
||||||
simgear::GroundLightManager::instance()->getGroundLightStateSet()->clear();
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue