diff options
Diffstat (limited to 'indra/llcommon')
| -rwxr-xr-x | indra/llcommon/llapp.cpp | 70 | ||||
| -rwxr-xr-x | indra/llcommon/llapp.h | 2 | 
2 files changed, 42 insertions, 30 deletions
| diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 5c8fff051f..63a38f2884 100755 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -320,7 +320,7 @@ void EnableCrashingOnCrashes()  }  #endif -void LLApp::setupErrorHandling() +void LLApp::setupErrorHandling(bool second_instance)  {  	// Error handling is done by starting up an error handling thread, which just sleeps and  	// occasionally checks to see if the app is in an error state, and sees if it needs to be run. @@ -337,40 +337,52 @@ void LLApp::setupErrorHandling()  	// Install the Google Breakpad crash handler for Windows  	if(mExceptionHandler == 0)  	{ -		llwarns << "adding breakpad exception handler" << llendl; +		if ( second_instance )  //BUG-5707 Firing teleport from a web browser causes second  +		{ +			mExceptionHandler = new google_breakpad::ExceptionHandler( +															L"C:\\Temp\\",		 +															0,		//No filter +															windows_post_minidump_callback, +															0, +															google_breakpad::ExceptionHandler::HANDLER_ALL);  //No custom client info. +		} +		else +		{ +			llwarns << "adding breakpad exception handler" << llendl; -		std::wstring wpipe_name; -		wpipe_name =  mCrashReportPipeStr + wstringize(getPid()); +			std::wstring wpipe_name; +			wpipe_name =  mCrashReportPipeStr + wstringize(getPid()); -		const std::wstring wdump_path(wstringize(mDumpPath)); +			const std::wstring wdump_path(wstringize(mDumpPath)); -		int retries = 30; -		for (; retries > 0; --retries) -		{ -			if (mExceptionHandler != 0) delete mExceptionHandler; - -			mExceptionHandler = new google_breakpad::ExceptionHandler( -														wdump_path,		 -														NULL,		//No filter -														windows_post_minidump_callback, -														0, -														google_breakpad::ExceptionHandler::HANDLER_ALL, -														MiniDumpNormal, //Generate a 'normal' minidump. -														wpipe_name.c_str(), -														NULL);  //No custom client info. -			if (mExceptionHandler->IsOutOfProcess()) +			int retries = 30; +			for (; retries > 0; --retries)  			{ -				LL_INFOS("CRASHREPORT") << "Successfully attached to Out of Process exception handler." << LL_ENDL; -				break; -			} -			else -			{ -				LL_WARNS("CRASHREPORT") << "Unable to attach to Out of Process exception handler.  " << retries << " retries remaining." << LL_ENDL;  -				::Sleep(100);  //Wait a tick and try again. +				if (mExceptionHandler != 0) delete mExceptionHandler; + +				mExceptionHandler = new google_breakpad::ExceptionHandler( +															wdump_path,		 +															NULL,		//No filter +															windows_post_minidump_callback, +															0, +															google_breakpad::ExceptionHandler::HANDLER_ALL, +															MiniDumpNormal, //Generate a 'normal' minidump. +															wpipe_name.c_str(), +															NULL);  //No custom client info. +				if (mExceptionHandler->IsOutOfProcess()) +				{ +					LL_INFOS("CRASHREPORT") << "Successfully attached to Out of Process exception handler." << LL_ENDL; +					break; +				} +				else +				{ +					LL_WARNS("CRASHREPORT") << "Unable to attach to Out of Process exception handler.  " << retries << " retries remaining." << LL_ENDL;  +					::Sleep(100);  //Wait a tick and try again. +				}  			} -		} -		if (retries == 0) LL_WARNS("CRASHREPORT") << "Unable to attach to Out of Process exception handler." << LL_ENDL; +			if (retries == 0) LL_WARNS("CRASHREPORT") << "Unable to attach to Out of Process exception handler." << LL_ENDL; +		}  		if (mExceptionHandler)  		{ diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index 828965b1fa..3f7bf2ca47 100755 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -214,7 +214,7 @@ public:  	 * DO NOT call this method if your application has specialized  	 * error handling code.  	 */ -	void setupErrorHandling(); +	void setupErrorHandling(bool mSecondInstance=false);  	void setErrorHandler(LLAppErrorHandler handler);  	static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred. | 
