diff options
Diffstat (limited to 'linden/indra/newview/llappviewermacosx.cpp')
-rw-r--r-- | linden/indra/newview/llappviewermacosx.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/linden/indra/newview/llappviewermacosx.cpp b/linden/indra/newview/llappviewermacosx.cpp index 3cdcb35..4a37503 100644 --- a/linden/indra/newview/llappviewermacosx.cpp +++ b/linden/indra/newview/llappviewermacosx.cpp | |||
@@ -135,6 +135,31 @@ bool LLAppViewerMacOSX::init() | |||
135 | return LLAppViewer::init(); | 135 | return LLAppViewer::init(); |
136 | } | 136 | } |
137 | 137 | ||
138 | bool LLAppViewerMacOSX::initLogging() | ||
139 | { | ||
140 | // Remove the crash stack log from previous executions. | ||
141 | // Since we've started logging a new instance of the app, we can assume | ||
142 | // The old crash stack is invalid for the next crash report. | ||
143 | char path[MAX_PATH]; | ||
144 | FSRef folder; | ||
145 | if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) | ||
146 | { | ||
147 | // folder is an FSRef to ~/Library/Logs/ | ||
148 | if(FSRefMakePath(&folder, (UInt8*)&path, sizeof(path)) == noErr) | ||
149 | { | ||
150 | std::string pathname = std::string(path) + std::string("/CrashReporter/"); | ||
151 | std::string mask = "Second Life*"; | ||
152 | std::string file_name; | ||
153 | while(gDirUtilp->getNextFileInDir(pathname, mask, file_name, false)) | ||
154 | { | ||
155 | LLFile::remove(pathname + file_name); | ||
156 | } | ||
157 | } | ||
158 | } | ||
159 | |||
160 | return LLAppViewer::initLogging(); | ||
161 | } | ||
162 | |||
138 | // MacOSX may add and addition command line arguement for the process serial number. | 163 | // MacOSX may add and addition command line arguement for the process serial number. |
139 | // The option takes a form like '-psn_0_12345'. The following method should be able to recognize | 164 | // The option takes a form like '-psn_0_12345'. The following method should be able to recognize |
140 | // and either ignore or return a pair of values for the option. | 165 | // and either ignore or return a pair of values for the option. |