1
0
Fork 0

FGViewer fixes

- ensure active material are cached
 - clear osgDB object cache on exit explicitly
This commit is contained in:
James Turner 2014-01-29 10:10:53 +00:00
parent 61da998e02
commit b7a9aee796
2 changed files with 8 additions and 1 deletions

View file

@ -226,5 +226,11 @@ fgviewerMain(int argc, char** argv)
// pass the loaded scene graph to the viewer.
viewer.setSceneData(loadedModel.get());
return viewer.run();
int result = viewer.run();
// clear cache now, since it contains SimGear objects. Otherwise SG_LOG
// calls during shutdown will cause crashes.
osgDB::Registry::instance()->clearObjectCache();
return result;
}

View file

@ -188,6 +188,7 @@ main(int argc, char** argv)
SG_LOG(SG_GENERAL, SG_ALERT, "Problems loading FlightGear materials.\n"
<< "Probably FG_ROOT is not properly set.");
}
ml->refreshActiveMaterials();
simgear::SGModelLib::init(fg_root, props);
// Set up the reader/writer options