diff options
Diffstat (limited to 'indra/newview/llappviewermacosx.cpp')
-rw-r--r-- | indra/newview/llappviewermacosx.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 1c32f0c564..7c2e341bed 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -135,6 +135,31 @@ bool LLAppViewerMacOSX::init() return LLAppViewer::init(); } +bool LLAppViewerMacOSX::initLogging() +{ + // Remove the crash stack log from previous executions. + // Since we've started logging a new instance of the app, we can assume + // The old crash stack is invalid for the next crash report. + char path[MAX_PATH]; + FSRef folder; + if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) + { + // folder is an FSRef to ~/Library/Logs/ + if(FSRefMakePath(&folder, (UInt8*)&path, sizeof(path)) == noErr) + { + std::string pathname = std::string(path) + std::string("/CrashReporter/"); + std::string mask = "Second Life*"; + std::string file_name; + while(gDirUtilp->getNextFileInDir(pathname, mask, file_name, false)) + { + LLFile::remove(pathname + file_name); + } + } + } + + return LLAppViewer::initLogging(); +} + // MacOSX may add and addition command line arguement for the process serial number. // The option takes a form like '-psn_0_12345'. The following method should be able to recognize // and either ignore or return a pair of values for the option. |