summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturefetch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rw-r--r--indra/newview/lltexturefetch.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 0053ce8df8..b1b3ae473c 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -431,11 +431,11 @@ LLTextureFetchWorker::~LLTextureFetchWorker()
// << " Desired=" << mDesiredDiscard << llendl;
llassert_always(!haveWork());
lockWorkMutex();
- if (mCacheReadHandle != LLTextureCache::nullHandle())
+ if (mCacheReadHandle != LLTextureCache::nullHandle() && mFetcher->mTextureCache)
{
mFetcher->mTextureCache->readComplete(mCacheReadHandle, true);
}
- if (mCacheWriteHandle != LLTextureCache::nullHandle())
+ if (mCacheWriteHandle != LLTextureCache::nullHandle() && mFetcher->mTextureCache)
{
mFetcher->mTextureCache->writeComplete(mCacheWriteHandle, true);
}
@@ -1429,6 +1429,8 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image
LLTextureFetch::~LLTextureFetch()
{
+ clearDeleteList() ;
+
// ~LLQueuedThread() called here
}
@@ -1737,6 +1739,26 @@ S32 LLTextureFetch::update(U32 max_time_ms)
return res;
}
+//called in the MAIN thread after the TextureCacheThread shuts down.
+void LLTextureFetch::shutDownTextureCacheThread()
+{
+ if(mTextureCache)
+ {
+ llassert_always(mTextureCache->isQuitting() || mTextureCache->isStopped()) ;
+ mTextureCache = NULL ;
+ }
+}
+
+//called in the MAIN thread after the ImageDecodeThread shuts down.
+void LLTextureFetch::shutDownImageDecodeThread()
+{
+ if(mImageDecodeThread)
+ {
+ llassert_always(mImageDecodeThread->isQuitting() || mImageDecodeThread->isStopped()) ;
+ mImageDecodeThread = NULL ;
+ }
+}
+
// WORKER THREAD
void LLTextureFetch::startThread()
{