1
0
Fork 0

Clear GroundLightManager on exit to avoid segfault

While mostly harmless since you're exiting anyway, it's an annoying
distraction when the real problem is "unexpected exit" (e.g.
https://bugs.debian.org/763285 ), and blocks testing with LeakSanitizer
This commit is contained in:
Rebecca N. Palmer 2015-02-12 16:39:28 +00:00
parent 84b240b84c
commit 033957003f

View file

@ -54,6 +54,7 @@ extern bool global_crashRptEnabled;
#include <simgear/math/SGMath.hxx>
#include <simgear/math/sg_random.h>
#include <simgear/misc/strutils.hxx>
#include <simgear/scene/tgdb/GroundLightManager.hxx>
#include <Model/panelnode.hxx>
#include <Scenery/scenery.hxx>
@ -529,6 +530,9 @@ int fgMainInit( int argc, char **argv )
// delete the NavCache here. This will cause the destruction of many cached
// objects (eg, airports, navaids, runways).
delete flightgear::NavDataCache::instance();
simgear::GroundLightManager::instance()->getRunwayLightStateSet()->clear();
simgear::GroundLightManager::instance()->getTaxiLightStateSet()->clear();
simgear::GroundLightManager::instance()->getGroundLightStateSet()->clear();
return result;
}