From f04d5f8758ef4b5524a9396a84351bf86db6763e Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 11 Mar 2014 16:45:31 +0000 Subject: [PATCH] Reset: work with threaded OSG modes --- src/Main/fg_init.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index d39f3ef61..f041f9d4f 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -971,13 +971,16 @@ void fgStartNewReset() } } // of top-level groups iteration + FGRenderer* render = globals->get_renderer(); + // needed or we crash in multi-threaded OSG mode + render->getViewer()->stopThreading(); + // order is important here since tile-manager shutdown needs to // access the scenery object globals->set_tile_mgr(NULL); globals->set_scenery(NULL); flightgear::CameraGroup::setDefault(NULL); - FGRenderer* render = globals->get_renderer(); // don't cancel the pager until after shutdown, since AIModels (and // potentially others) can queue delete requests on the pager. render->getViewer()->getDatabasePager()->cancel(); @@ -1024,6 +1027,7 @@ void fgStartNewReset() // must do this before splashinit for Rembrandt flightgear::CameraGroup::buildDefaultGroup(viewer.get()); render->splashinit(); + viewer->startThreading(); fgOSResetProperties();