Re-ordered the creating of the DatagbaseThread to avoid startThread being called twice.

This commit is contained in:
Robert Osfield 2018-03-25 12:14:46 +01:00
parent 20cbb25cd1
commit 68ec892419

View File

@ -1530,8 +1530,6 @@ void DatabasePager::requestNodeFile(const std::string& fileName, osg::NodePath&
if (!_startThreadCalled) if (!_startThreadCalled)
{ {
_startThreadCalled = true;
_done = false;
OSG_INFO<<"DatabasePager::startThread()"<<std::endl; OSG_INFO<<"DatabasePager::startThread()"<<std::endl;
if (_databaseThreads.empty()) if (_databaseThreads.empty())
@ -1541,6 +1539,9 @@ void DatabasePager::requestNodeFile(const std::string& fileName, osg::NodePath&
osg::DisplaySettings::instance()->getNumOfHttpDatabaseThreadsHint()); osg::DisplaySettings::instance()->getNumOfHttpDatabaseThreadsHint());
} }
_startThreadCalled = true;
_done = false;
for(DatabaseThreadList::const_iterator dt_itr = _databaseThreads.begin(); for(DatabaseThreadList::const_iterator dt_itr = _databaseThreads.begin();
dt_itr != _databaseThreads.end(); dt_itr != _databaseThreads.end();
++dt_itr) ++dt_itr)