From b0d4919fd453fea9afc1cc0745140e83992997b6 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 4 Mar 2010 15:02:30 -0700 Subject: fix for EXT-5683: viewer crashes at llcommon/llworkerthread.cpp(323): ERROR: LLWorkerClass::checkWork: ASSERT(workreq). --- indra/newview/llappviewer.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 948d38befb..d7b605fb08 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1515,7 +1515,7 @@ bool LLAppViewer::cleanup() LLAvatarIconIDCache::getInstance()->save(); llinfos << "Shutting down Threads" << llendflush; - + // Let threads finish LLTimer idleTimer; idleTimer.reset(); @@ -1529,19 +1529,26 @@ bool LLAppViewer::cleanup() pending += LLVFSThread::updateClass(0); pending += LLLFSThread::updateClass(0); F64 idle_time = idleTimer.getElapsedTimeF64(); - if (!pending || idle_time >= max_idle_time) + if(!pending) + { + break ; //done + } + else if(idle_time >= max_idle_time) { llwarns << "Quitting with pending background tasks." << llendl; break; } } - + // Delete workers first // shotdown all worker threads before deleting them in case of co-dependencies sTextureCache->shutdown(); sTextureFetch->shutdown(); sImageDecodeThread->shutdown(); + sTextureFetch->shutDownTextureCacheThread() ; + sTextureFetch->shutDownImageDecodeThread() ; + delete sTextureCache; sTextureCache = NULL; delete sTextureFetch; -- cgit v1.2.3