diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index e623baa6533fa70ffa64bca4594525d5c9079ede..eda61d3c74ea97ac3b1977f14f9bac34b51c1082 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -2268,6 +2268,10 @@ void LLImageGLThread::run() LL_PROFILE_ZONE_SCOPED; // We must perform setup on this thread before actually servicing our // WorkQueue, likewise cleanup afterwards. + while (mContext == nullptr) + { // HACK -- wait for mContext to be initialized since this thread will usually start before mContext is set + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } mWindow->makeContextCurrent(mContext); gGL.init(); ThreadPool::run(); diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 27496def1d62b184731a2cd9312ca78e71a9c197..ae773bb36259393981a6d509f2750a8e0d0697b8 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -324,7 +324,7 @@ class LLImageGLThread : public LLSimpleton<LLImageGLThread>, LL::ThreadPool private: LLWindow* mWindow; - void* mContext; + void* mContext = nullptr; LLAtomicBool mFinished; };