diff options
author | Adam Moss <moss@lindenlab.com> | 2009-05-04 17:43:26 +0000 |
---|---|---|
committer | Adam Moss <moss@lindenlab.com> | 2009-05-04 17:43:26 +0000 |
commit | cc92525b0df952659102d2e5adcc4140fea7f371 (patch) | |
tree | ee1a9b63decb3667fb740a8c9b70bcfdbf9a054b /indra/newview/llappviewer.cpp | |
parent | 4bcbf3342284b19ff5fbda5a16a43a8cafb3baad (diff) |
QAR-1476 Combo-merge to trunk: Viewer 1.23 RC0 and Simulator 1.26.3
svn merge -r118927:118939
svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-1.23.0-merge-2-combo-QAR-1476
this is a composite of...
svn merge -r115088:118182
svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer_1-23
conflicts resolved:
C doc/contributions.txt
C indra/llaudio/audioengine.cpp
C indra/newview/CMakeLists.txt
C indra/newview/llfloaterlandholdings.cpp
C indra/newview/llpaneldirbrowser.cpp
C indra/newview/llpanelgrouplandmoney.cpp
C indra/newview/llpreviewscript.cpp
C indra/newview/llviewermenu.cpp
C indra/newview/skins/default/xui/en-us/notifications.xml
and...
svn merge -r116937:118673
svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.26
minor-to-trivial conflicts resolved:
C indra/llcommon/llversionserver.h
C indra/newsim/llrezdata.cpp
C indra/newsim/llstate.cpp
C indra/upgrade/schema_version/sequence/3/index_log_paypal.sql
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 115 |
1 files changed, 67 insertions, 48 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 43800c67fa..f2154a05dc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -848,7 +848,6 @@ bool LLAppViewer::mainLoop() try { LLFastTimer t(LLFastTimer::FTM_FRAME); - pingMainloopTimeout("Main:MiscNativeWindowEvents"); { @@ -1999,38 +1998,9 @@ bool LLAppViewer::initConfiguration() } initMarkerFile(); - -#if LL_SEND_CRASH_REPORTS - if (gLastExecEvent == LAST_EXEC_FROZE) - { - llinfos << "Last execution froze, requesting to send crash report." << llendl; - // - // Pop up a freeze or crash warning dialog - // - std::ostringstream msg; - msg << gSecondLife - << " appears to have frozen or crashed on the previous run.\n" - << "Would you like to send a crash report?"; - std::string alert; - alert = gSecondLife; - alert += " Alert"; - S32 choice = OSMessageBox(msg.str(), - alert, - OSMB_YESNO); - if (OSBTN_YES == choice) - { - llinfos << "Sending crash report." << llendl; - - bool report_freeze = true; - handleCrashReporting(report_freeze); - } - else - { - llinfos << "Not sending crash report." << llendl; - } - } -#endif // #if LL_SEND_CRASH_REPORTS - } + + checkForCrash(); + } else { mSecondInstance = anotherInstanceRunning(); @@ -2048,6 +2018,11 @@ bool LLAppViewer::initConfiguration() } initMarkerFile(); + + if(!mSecondInstance) + { + checkForCrash(); + } } // need to do this here - need to have initialized global settings first @@ -2062,6 +2037,43 @@ bool LLAppViewer::initConfiguration() return true; // Config was successful. } + +void LLAppViewer::checkForCrash(void) +{ + +#if LL_SEND_CRASH_REPORTS + if (gLastExecEvent == LAST_EXEC_FROZE || gLastExecEvent == LAST_EXEC_OTHER_CRASH) + { + llinfos << "Last execution froze, requesting to send crash report." << llendl; + // + // Pop up a freeze or crash warning dialog + // + std::ostringstream msg; + msg << gSecondLife + << " appears to have frozen or crashed on the previous run.\n" + << "Would you like to send a crash report?"; + std::string alert; + alert = gSecondLife; + alert += " Alert"; + S32 choice = OSMessageBox(msg.str(), + alert, + OSMB_YESNO); + if (OSBTN_YES == choice) + { + llinfos << "Sending crash report." << llendl; + + bool report_freeze = true; + handleCrashReporting(report_freeze); + } + else + { + llinfos << "Not sending crash report." << llendl; + } + } +#endif // LL_SEND_CRASH_REPORTS + +} + bool LLAppViewer::initWindow() { LL_INFOS("AppInit") << "Initializing window..." << LL_ENDL; @@ -2397,6 +2409,10 @@ void LLAppViewer::handleViewerCrash() LLError::logToFile(""); +// On Mac, we send the report on the next run, since we need macs crash report +// for a stack trace, so we have to let it the app fail. +#if !LL_DARWIN + // Remove the marker file, since otherwise we'll spawn a process that'll keep it locked if(gDebugInfo["LastExecEvent"].asInteger() == LAST_EXEC_LOGOUT_CRASH) { @@ -2410,6 +2426,8 @@ void LLAppViewer::handleViewerCrash() // Call to pure virtual, handled by platform specific llappviewer instance. pApp->handleCrashReporting(); +#endif //!LL_DARWIN + return; } @@ -2465,6 +2483,13 @@ void LLAppViewer::initMarkerFile() std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME); std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); + + if (LLAPRFile::isExist(mMarkerFileName, NULL, LL_APR_RB) && !anotherInstanceRunning()) + { + gLastExecEvent = LAST_EXEC_FROZE; + LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL; + } + if(LLAPRFile::isExist(logout_marker_file, NULL, LL_APR_RB)) { LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << LL_ENDL; @@ -2487,18 +2512,12 @@ void LLAppViewer::initMarkerFile() LLAPRFile::remove(llerror_marker_file); LLAPRFile::remove(error_marker_file); - //Freeze case checks + // No new markers if another instance is running. if(anotherInstanceRunning()) { return; } - if (LLAPRFile::isExist(mMarkerFileName, NULL, LL_APR_RB)) - { - gLastExecEvent = LAST_EXEC_FROZE; - LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL; - } - // Create the marker file for this execution & lock it apr_status_t s; s = mMarkerFile.open(mMarkerFileName, LL_APR_W, gAPRPoolp); @@ -2873,17 +2892,17 @@ bool LLAppViewer::initCache() gSavedSettings.setU32("VFSSalt", new_salt); // Don't remove VFS after viewer crashes. If user has corrupt data, they can reinstall. JC - gVFS = new LLVFS(new_vfs_index_file, new_vfs_data_file, false, vfs_size_u32, false); - if( VFSVALID_BAD_CORRUPT == gVFS->getValidState() ) + gVFS = LLVFS::createLLVFS(new_vfs_index_file, new_vfs_data_file, false, vfs_size_u32, false); + if( !gVFS ) { - // Try again with fresh files - // (The constructor deletes corrupt files when it finds them.) - LL_WARNS("AppCache") << "VFS corrupt, deleted. Making new VFS." << LL_ENDL; - delete gVFS; - gVFS = new LLVFS(new_vfs_index_file, new_vfs_data_file, false, vfs_size_u32, false); + return false; } - gStaticVFS = new LLVFS(static_vfs_index_file, static_vfs_data_file, true, 0, false); + gStaticVFS = LLVFS::createLLVFS(static_vfs_index_file, static_vfs_data_file, true, 0, false); + if( !gStaticVFS ) + { + return false; + } BOOL success = gVFS->isValid() && gStaticVFS->isValid(); if( !success ) |