FGViewer fixes
- ensure active material are cached - clear osgDB object cache on exit explicitly
This commit is contained in:
parent
61da998e02
commit
b7a9aee796
2 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue