1
0
Fork 0

Fix for the fix: check for a viewer.

- avoid a crash if we bail out before creating the viewer (missing
data or bad aircraft)
This commit is contained in:
James Turner 2013-12-30 17:16:53 +00:00
parent b0db2a764f
commit 47e802e674

View file

@ -214,8 +214,10 @@ FGGlobals::~FGGlobals()
// don't cancel the pager until after shutdown, since AIModels (and
// potentially others) can queue delete requests on the pager.
renderer->getViewer()->getDatabasePager()->cancel();
renderer->getViewer()->getDatabasePager()->clear();
if (renderer->getViewer() && renderer->getViewer()->getDatabasePager()) {
renderer->getViewer()->getDatabasePager()->cancel();
renderer->getViewer()->getDatabasePager()->clear();
}
osgDB::Registry::instance()->clearObjectCache();
// renderer touches subsystems during its destruction