Fix crash on exit (cancel the osgDB pager)
- borrow some code from the new reset codepath to cleanly stop the OSG pager thread during normal shutdown. Avoids a race-condition destroying various structures the pager thread might be modifying.
This commit is contained in:
parent
fe61a98ca5
commit
b0db2a764f
1 changed files with 9 additions and 0 deletions
|
@ -27,6 +27,9 @@
|
|||
#include <boost/foreach.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgDB/Registry>
|
||||
|
||||
#include <simgear/structure/commands.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/sg_dir.hxx>
|
||||
|
@ -209,6 +212,12 @@ FGGlobals::~FGGlobals()
|
|||
subsystem_mgr->remove("model-manager");
|
||||
_tile_mgr.clear();
|
||||
|
||||
// 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();
|
||||
osgDB::Registry::instance()->clearObjectCache();
|
||||
|
||||
// renderer touches subsystems during its destruction
|
||||
set_renderer(NULL);
|
||||
_scenery.clear();
|
||||
|
|
Loading…
Add table
Reference in a new issue