From 827d8814cf1e6511333824273b624f0b814ce359 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 9 Oct 2012 13:34:28 -0500 Subject: MAINT-1688 Potential fix for crash on exit in LLTextureFetch --- indra/llmessage/llcurl.cpp | 6 ++++++ indra/newview/llappviewer.cpp | 23 +++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 158e4ce091..10c83e6572 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -1104,6 +1104,7 @@ bool LLCurlRequest::getByteRange(const std::string& url, S32 offset, S32 length, LLCurl::ResponderPtr responder) { + llassert(LLCurl::sNotQuitting); LLCurl::Easy* easy = allocEasy(); if (!easy) { @@ -1126,6 +1127,7 @@ bool LLCurlRequest::post(const std::string& url, const LLSD& data, LLCurl::ResponderPtr responder, S32 time_out) { + llassert(LLCurl::sNotQuitting); LLCurl::Easy* easy = allocEasy(); if (!easy) { @@ -1153,6 +1155,7 @@ bool LLCurlRequest::post(const std::string& url, const std::string& data, LLCurl::ResponderPtr responder, S32 time_out) { + llassert(LLCurl::sNotQuitting); LLCurl::Easy* easy = allocEasy(); if (!easy) { @@ -1550,6 +1553,8 @@ void LLCurl::cleanupClass() //static CURLM* LLCurl::newMultiHandle() { + llassert(sNotQuitting); + LLMutexLock lock(sHandleMutexp) ; if(sTotalHandles + 1 > sMaxHandles) @@ -1583,6 +1588,7 @@ CURLMcode LLCurl::deleteMultiHandle(CURLM* handle) //static CURL* LLCurl::newEasyHandle() { + llassert(sNotQuitting); LLMutexLock lock(sHandleMutexp) ; if(sTotalHandles + 1 > sMaxHandles) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2b6d6d15fa..b8b7cc0655 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1884,10 +1884,21 @@ bool LLAppViewer::cleanup() sTextureFetch->shutDownTextureCacheThread() ; sTextureFetch->shutDownImageDecodeThread() ; + llinfos << "Shutting down message system" << llendflush; + end_messaging_system(); + + // *NOTE:Mani - The following call is not thread safe. + LL_CHECK_MEMORY + LLCurl::cleanupClass(); + LL_CHECK_MEMORY + LLFilePickerThread::cleanupClass(); + //MUST happen AFTER LLCurl::cleanupClass delete sTextureCache; sTextureCache = NULL; + delete sTextureFetch; + sTextureFetch = NULL; delete sImageDecodeThread; sImageDecodeThread = NULL; delete mFastTimerLogThread; @@ -1952,18 +1963,6 @@ bool LLAppViewer::cleanup() LLViewerAssetStatsFF::cleanup(); - llinfos << "Shutting down message system" << llendflush; - end_messaging_system(); - - // *NOTE:Mani - The following call is not thread safe. - LL_CHECK_MEMORY - LLCurl::cleanupClass(); - LL_CHECK_MEMORY - - //MUST happen AFTER LLCurl::cleanupClass - delete sTextureFetch; - sTextureFetch = NULL; - // If we're exiting to launch an URL, do that here so the screen // is at the right resolution before we launch IE. if (!gLaunchFileOnQuit.empty()) -- cgit v1.2.3 From bf9eb5cc25e6b50d0a3d10168d0065d0117f146e Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 10 Oct 2012 09:16:02 -0400 Subject: tag merge of DRTVWR-226 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index cc02276c89..61c8832dc1 100644 --- a/.hgtags +++ b/.hgtags @@ -311,3 +311,4 @@ ceed0b65a69f1eac20d523e0203320a32f9a3f3c DRTVWR-215 baa627938dbb7956f45e1eebef11ffe9e7f2e5bc 3.4.1-beta1 5adb2b8f96c3cac88ad7c7d996d707f1b29df336 3.4.1-beta1 b3f74858a1c8720c82d0978f3877a3fc8ba459ec 3.4.1-beta1a +29075f8c1abed53dcf195a59f61744e27a91108f DRTVWR-226 -- cgit v1.2.3