diff options
author | Dave Parks <davep@lindenlab.com> | 2022-06-07 15:12:58 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-06-07 15:12:58 -0500 |
commit | 197baebc62d1e4b922730266f77f4e6b555e2cac (patch) | |
tree | 617d62fdb87a4baaff2cbeb83407466f6e19eb22 /indra/newview/lltexturefetch.cpp | |
parent | 5259fa811c11892ef150f853c9de5a8927fa68a6 (diff) |
SL-17547 Fix for crash in getCurrentDiscardLevelForFetching (and add runtime check and assertion to avoid crash in production and detect crash in development).
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 64ccbf5e4a..2bfdfe1789 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1071,7 +1071,7 @@ void LLTextureFetchWorker::setDesiredDiscard(S32 discard, S32 size) // Locks: Mw void LLTextureFetchWorker::setImagePriority(F32 priority) { - mImagePriority = priority; //should map to max virtual size + mImagePriority = priority; //should map to max virtual size, abort if zero } // Locks: Mw @@ -1397,7 +1397,7 @@ bool LLTextureFetchWorker::doWork(S32 param) else { // Shouldn't need to do anything here - llassert(mFetcher->mNetworkQueue.find(mID) != mFetcher->mNetworkQueue.end()); + //llassert(mFetcher->mNetworkQueue.find(mID) != mFetcher->mNetworkQueue.end()); return false; } } @@ -3011,16 +3011,18 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, bool LLTextureFetch::updateRequestPriority(const LLUUID& id, F32 priority) { LL_PROFILE_ZONE_SCOPED; - bool res = false; - LLTextureFetchWorker* worker = getWorker(id); - if (worker) - { - worker->lockWorkMutex(); // +Mw - worker->setImagePriority(priority); - worker->unlockWorkMutex(); // -Mw - res = true; - } - return res; + mRequestQueue.post([=]() + { + LLTextureFetchWorker* worker = getWorker(id); + if (worker) + { + worker->lockWorkMutex(); // +Mw + worker->setImagePriority(priority); + worker->unlockWorkMutex(); // -Mw + } + }); + + return true; } // Replicates and expands upon the base class's |