summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lltexturecache.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 6a4b967487..9be342c424 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -1541,23 +1541,24 @@ bool LLTextureCache::readComplete(handle_t handle, bool abort)
{
lockWorkers();
handle_map_t::iterator iter = mReaders.find(handle);
- llassert_always(iter != mReaders.end() || abort);
- LLTextureCacheWorker* worker = iter->second;
- if (!worker)
- return false;
- bool res = worker->complete();
- if (res || abort)
+ LLTextureCacheWorker* worker = NULL;
+ bool complete = false;
+ if (iter != mReaders.end())
{
- mReaders.erase(handle);
+ worker = iter->second;
+ complete = worker->complete();
+ }
+ if (worker && (complete || abort))
+ {
+ mReaders.erase(iter);
unlockWorkers();
worker->scheduleDelete();
- return true;
}
else
{
unlockWorkers();
- return false;
}
+ return (complete || abort);
}
LLTextureCache::handle_t LLTextureCache::writeToCache(const LLUUID& id, U32 priority,