From ae3133522d18c1e456d22569137cdf45dac6b2f2 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 3 Sep 2018 12:30:02 +0100 Subject: [PATCH] Changed the logic for whether to call setUpThreading() in setThreadingModel() to make it possible to changed threadings even if the threading model starts of as SingleThreaded --- src/osgViewer/ViewerBase.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/osgViewer/ViewerBase.cpp b/src/osgViewer/ViewerBase.cpp index f5b325895..8b4ffe241 100644 --- a/src/osgViewer/ViewerBase.cpp +++ b/src/osgViewer/ViewerBase.cpp @@ -205,13 +205,11 @@ void ViewerBase::setThreadingModel(ThreadingModel threadingModel) { if (_threadingModel == threadingModel) return; - bool needSetUpThreading = _threadsRunning; - if (_threadsRunning) stopThreading(); _threadingModel = threadingModel; - if (needSetUpThreading) setUpThreading(); + if (isRealized() && _threadingModel!=SingleThreaded) setUpThreading(); } ViewerBase::ThreadingModel ViewerBase::suggestBestThreadingModel()