diff options
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rwxr-xr-x | indra/newview/lltexturefetch.cpp | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index e307de329b..8657fce093 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2075,27 +2075,18 @@ void LLTextureFetch::deleteRequest(const LLUUID& id, bool cancel) { lockQueue() ; LLTextureFetchWorker* worker = getWorkerAfterLock(id); - if (worker) - { - size_t erased_1 = mRequestMap.erase(worker->mID); - unlockQueue() ; - - llassert_always(erased_1 > 0) ; - - removeFromNetworkQueue(worker, cancel); - llassert_always(!(worker->getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) ; + unlockQueue() ; - worker->removeFromHTTPQueue(); - worker->scheduleDelete(); - } - else - { - unlockQueue() ; - } + removeRequest(worker, cancel); } void LLTextureFetch::removeRequest(LLTextureFetchWorker* worker, bool cancel) { + if(!worker) + { + return; + } + lockQueue() ; size_t erased_1 = mRequestMap.erase(worker->mID); unlockQueue() ; @@ -2108,6 +2099,24 @@ void LLTextureFetch::removeRequest(LLTextureFetchWorker* worker, bool cancel) worker->scheduleDelete(); } +void LLTextureFetch::deleteAllRequests() +{ + while(1) + { + lockQueue(); + if(mRequestMap.empty()) + { + unlockQueue() ; + break; + } + + LLTextureFetchWorker* worker = mRequestMap.begin()->second; + unlockQueue() ; + + removeRequest(worker, true); + } +} + S32 LLTextureFetch::getNumRequests() { lockQueue() ; |