From bb84f1ea3c23625a645b9c2848202bca7c566efb Mon Sep 17 00:00:00 2001 From: "Konstantin S. Matveyev" Date: Sat, 13 Jan 2018 15:46:53 +0300 Subject: [PATCH] osgViewer::ViewerBase setThreadingModel func fix: should not start threading, must only restart --- src/osgViewer/ViewerBase.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osgViewer/ViewerBase.cpp b/src/osgViewer/ViewerBase.cpp index 4b72f5c20..f5b325895 100644 --- a/src/osgViewer/ViewerBase.cpp +++ b/src/osgViewer/ViewerBase.cpp @@ -205,11 +205,13 @@ void ViewerBase::setThreadingModel(ThreadingModel threadingModel) { if (_threadingModel == threadingModel) return; + bool needSetUpThreading = _threadsRunning; + if (_threadsRunning) stopThreading(); _threadingModel = threadingModel; - setUpThreading(); + if (needSetUpThreading) setUpThreading(); } ViewerBase::ThreadingModel ViewerBase::suggestBestThreadingModel()