From 033957003f4be52ea554a4260b70f1f97440dca0 Mon Sep 17 00:00:00 2001 From: "Rebecca N. Palmer" Date: Thu, 12 Feb 2015 16:39:28 +0000 Subject: [PATCH] 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 --- src/Main/main.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index ebcb6bb7f..e77e70e15 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -54,6 +54,7 @@ extern bool global_crashRptEnabled; #include #include #include +#include #include #include @@ -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; } -- 2.39.5