diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 2cea1aeea..2a950c33f 100755 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -1435,20 +1435,22 @@ void fgStartNewReset() sgUserDataInit( globals->get_props() ); + unsigned int numDBPagerThreads = fgGetNode("/sim/rendering/database-pager/threads", true)->getIntValue(2); + if (composite_viewer) { - composite_viewer_view->getDatabasePager()->setUpThreads(2, 1); + composite_viewer_view->setDatabasePager(FGScenery::getPagerSingleton()); + composite_viewer_view->getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true, false); + composite_viewer_view->getDatabasePager()->setUpThreads(numDBPagerThreads, 1); composite_viewer_view->getDatabasePager()->setAcceptNewDatabaseRequests(true); flightgear::CameraGroup::buildDefaultGroup(composite_viewer_view); composite_viewer_view->setFrameStamp(composite_viewer->getFrameStamp()); - composite_viewer_view->setDatabasePager(FGScenery::getPagerSingleton()); - composite_viewer_view->getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true, false); osg::GraphicsContext::createNewContextID(); render->setView(composite_viewer_view); render->preinit(); composite_viewer->startThreading(); } else { - viewer->getDatabasePager()->setUpThreads(2, 1); + viewer->getDatabasePager()->setUpThreads(numDBPagerThreads, 1); viewer->getDatabasePager()->setAcceptNewDatabaseRequests(true); // must do this before preinit for Rembrandthe flightgear::CameraGroup::buildDefaultGroup(viewer.get());