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:
parent
b0db2a764f
commit
47e802e674
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue