diff --git a/indra/llcommon/threadpool.cpp b/indra/llcommon/threadpool.cpp index d5adf11264cfc25f8de690f545a2a80807355c50..4a7ead2110863079019db962b3c72a5f2868f3c7 100644 --- a/indra/llcommon/threadpool.cpp +++ b/indra/llcommon/threadpool.cpp @@ -39,6 +39,11 @@ void LL::ThreadPool::start() run(tname); }); } + + // Special workflow for LLWindowWin32Thread - it's close() should be called explicitly + if (mExplicitShutdown) + return; + // Listen on "LLApp", and when the app is shutting down, close the queue // and join the workers. LLEventPumps::instance().obtain("LLApp").listen( diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h index f8eec3b45744d8a18532811a24901fe84271f62a..0a5f14529bad6a12903afb684143d41377b0ce13 100644 --- a/indra/llcommon/threadpool.h +++ b/indra/llcommon/threadpool.h @@ -59,6 +59,10 @@ namespace LL */ virtual void run(); + protected: + // LLWindowWin32Thread should set this flag to true + bool mExplicitShutdown { false }; + private: void run(const std::string& name); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 41f3042ace01102dfbeff1c11503910154f99fc7..afe26ec5a413513d41fca75b1cea6937dc28b354 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -4581,6 +4581,9 @@ std::vector<std::string> LLWindowWin32::getDynamicFallbackFontList() inline LLWindowWin32::LLWindowWin32Thread::LLWindowWin32Thread() : ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE) { + // Set this flag to true to avoid of implicit call of close() from start() + mExplicitShutdown = true; + ThreadPool::start(); }