diff options
author | Richard Linden <none@none> | 2013-12-10 12:50:23 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2013-12-10 12:50:23 -0800 |
commit | d4f3fe3c5691348b72729ba57cef337c1dca0141 (patch) | |
tree | 0af459d66463e94d3c29b1ed22ddc7ff1dda7458 /indra/llcommon | |
parent | 8d5605e09f144e7879c34e6093b5c09c191f46a6 (diff) |
SH-4653 FIX Interesting: Viewer crashes while reading chat history
Diffstat (limited to 'indra/llcommon')
-rwxr-xr-x | indra/llcommon/llthread.cpp | 6 | ||||
-rwxr-xr-x | indra/llcommon/llthread.h | 6 | ||||
-rw-r--r-- | indra/llcommon/lltrace.cpp | 2 |
3 files changed, 12 insertions, 2 deletions
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index cf105098ef..368a059182 100755 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -132,7 +132,7 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap #endif // for now, hard code all LLThreads to report to single master thread recorder, which is known to be running on main thread - LLTrace::ThreadRecorder thread_recorder(*LLTrace::get_master_thread_recorder()); + mRecorder = new LLTrace::ThreadRecorder(*LLTrace::get_master_thread_recorder()); #if !LL_DARWIN sThreadID = threadp->mID; @@ -222,6 +222,8 @@ void LLThread::shutdown() // This thread just wouldn't stop, even though we gave it time //LL_WARNS() << "LLThread::~LLThread() exiting thread before clean exit!" << LL_ENDL; // Put a stake in its heart. + delete mRecorder; + apr_thread_exit(mAPRThreadp, -1); return; } @@ -239,6 +241,8 @@ void LLThread::shutdown() apr_pool_destroy(mAPRPoolp); mAPRPoolp = 0; } + + delete mRecorder; } diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index ba64d20936..2f9c779e00 100755 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -36,6 +36,11 @@ LL_COMMON_API void assert_main_thread(); +namespace LLTrace +{ + class ThreadRecorder; +} + class LL_COMMON_API LLThread { private: @@ -105,6 +110,7 @@ protected: BOOL mIsLocalPool; EThreadStatus mStatus; U32 mID; + LLTrace::ThreadRecorder* mRecorder; //a local apr_pool for APRFile operations in this thread. If it exists, LLAPRFile::sAPRFilePoolp should not be used. //Note: this pool is used by APRFile ONLY, do NOT use it for any other purposes. diff --git a/indra/llcommon/lltrace.cpp b/indra/llcommon/lltrace.cpp index 14e830af7d..54079a4689 100644 --- a/indra/llcommon/lltrace.cpp +++ b/indra/llcommon/lltrace.cpp @@ -40,7 +40,7 @@ StatBase::StatBase( const char* name, const char* description ) mDescription(description ? description : "") { #ifndef LL_RELEASE_FOR_DOWNLOAD - if (LLTrace::get_thread_recorder() != NULL) + if (LLTrace::get_thread_recorder().notNull()) { LL_ERRS() << "Attempting to declare trace object after program initialization. Trace objects should be statically initialized." << LL_ENDL; } |