Added minimum of 1 to make sure numProcessors is always valid

This commit is contained in:
Robert Osfield 2016-06-23 16:52:16 +01:00
parent 148d5e799e
commit b8d1e4d2f6

View File

@ -654,7 +654,7 @@ void CompositeViewer::realize()
if (osg::DisplaySettings::instance()->getCompileContextsHint())
{
int numProcessors = OpenThreads::GetNumberOfProcessors();
int numProcessors = osg::minimum(1, OpenThreads::GetNumberOfProcessors());
int processNum = 0;
for(unsigned int i=0; i<= osg::GraphicsContext::getMaxContextID(); ++i)