From 39860cfb7169a7e28689ccfe487e5e851d478d84 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 23 Jun 2016 16:53:12 +0100 Subject: [PATCH] Added minimum of 1 to make sure numProcessors is always valid --- src/osgViewer/Viewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index f23575113..7fe4bc366 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -596,7 +596,7 @@ void Viewer::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)