From ec63f019e2bfaf2f6b05ca6e93976beac6d0847d Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Tue, 2 Mar 2010 14:30:47 +0100 Subject: Vex Streeter, Merov Linden: SNOW-434 Unsafe threaded op. (lltexturefetch.cpp). --- linden/indra/newview/lltexturefetch.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'linden/indra/newview/lltexturefetch.cpp') diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp index 935b8cc..8ff9e9f 100644 --- a/linden/indra/newview/lltexturefetch.cpp +++ b/linden/indra/newview/lltexturefetch.cpp @@ -1472,8 +1472,12 @@ void LLTextureFetch::deleteRequest(const LLUUID& id, bool cancel) // protected void LLTextureFetch::addToNetworkQueue(LLTextureFetchWorker* worker) { + mQueueMutex.lock(); + bool is_worker_in_request_map = (mRequestMap.find(worker->mID) != mRequestMap.end()); + mQueueMutex.unlock(); + LLMutexLock lock(&mNetworkQueueMutex); - if (mRequestMap.find(worker->mID) != mRequestMap.end()) + if (is_worker_in_request_map) { // only add to the queue if in the request map // i.e. a delete has not been requested -- cgit v1.1