Skip to content

Commit 892fb2d

Browse files
committed
#4651 Fix marker presence check
1 parent 6e24218 commit 892fb2d

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

indra/newview/llappviewer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5403,6 +5403,12 @@ void LLAppViewer::createErrorMarker(eLastExecEvent error_code) const
54035403
}
54045404
}
54055405

5406+
bool LLAppViewer::errorMarkerExists() const
5407+
{
5408+
std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME);
5409+
return LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB);
5410+
}
5411+
54065412
void LLAppViewer::outOfMemorySoftQuit()
54075413
{
54085414
if (!mQuitRequested)

indra/newview/llappviewer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ class LLAppViewer : public LLApp
250250

251251
// Writes an error code into the error_marker file for use on next startup.
252252
void createErrorMarker(eLastExecEvent error_code) const;
253+
bool errorMarkerExists() const;
253254

254255
// Attempt a 'soft' quit with disconnect and saving of settings/cache.
255256
// Intended to be thread safe.

indra/newview/llappviewerwin32.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,13 @@ namespace
173173
<< '/' << loc.mV[2])));
174174
}
175175

176-
if (!LLAppViewer::instance()->isSecondInstance())
176+
LLAppViewer* app = LLAppViewer::instance();
177+
if (!app->isSecondInstance() && !app->errorMarkerExists())
177178
{
178-
std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME);
179-
if (!LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB))
180-
{
181-
// If marker doesn't exist, create a marker with 'other' code for next launch
182-
// otherwise don't override existing file
183-
// Any unmarked crashes will be considered as freezes
184-
LLAppViewer::instance()->createErrorMarker(LAST_EXEC_OTHER_CRASH);
185-
}
179+
// If marker doesn't exist, create a marker with 'other' code for next launch
180+
// otherwise don't override existing file
181+
// Any unmarked crashes will be considered as freezes
182+
app->createErrorMarker(LAST_EXEC_OTHER_CRASH);
186183
}
187184
} // MDSCB_EXCEPTIONCODE
188185

0 commit comments

Comments
 (0)