summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewerwin32.cpp
diff options
context:
space:
mode:
authorSimon Linden <simon@lindenlab.com>2014-07-18 22:28:33 +0000
committerSimon Linden <simon@lindenlab.com>2014-07-18 22:28:33 +0000
commit7714c7679da7c6c28c3f3f09af6b586a680dc26c (patch)
treef14c766b090f50cbb866123305f676e831ef483b /indra/newview/llappviewerwin32.cpp
parent1655887f30e40ea390b6dca9f64ac5e84309be05 (diff)
parentff3827f278d2d53f565bc585edc4db5bc5e5dc38 (diff)
Merge in downstream viewer-tiger
Diffstat (limited to 'indra/newview/llappviewerwin32.cpp')
-rw-r--r--indra/newview/llappviewerwin32.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 06f081e920..57fb84bbf1 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -438,7 +438,7 @@ void LLAppViewerWin32::disableWinErrorReporting()
const S32 MAX_CONSOLE_LINES = 500;
-void create_console()
+static bool create_console()
{
int h_con_handle;
long l_std_handle;
@@ -447,7 +447,7 @@ void create_console()
FILE *fp;
// allocate a console for this app
- AllocConsole();
+ const bool isConsoleAllocated = AllocConsole();
// set the screen buffer to be big enough to let us scroll text
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);
@@ -495,10 +495,13 @@ void create_console()
*stderr = *fp;
setvbuf( stderr, NULL, _IONBF, 0 );
}
+
+ return isConsoleAllocated;
}
LLAppViewerWin32::LLAppViewerWin32(const char* cmd_line) :
- mCmdLine(cmd_line)
+ mCmdLine(cmd_line),
+ mIsConsoleAllocated(false)
{
}
@@ -542,6 +545,16 @@ bool LLAppViewerWin32::cleanup()
gDXHardware.cleanup();
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ LLWinDebug::instance().cleanup();
+#endif
+
+ if (mIsConsoleAllocated)
+ {
+ FreeConsole();
+ mIsConsoleAllocated = false;
+ }
+
return result;
}
@@ -553,7 +566,7 @@ void LLAppViewerWin32::initLoggingAndGetLastDuration()
void LLAppViewerWin32::initConsole()
{
// pop up debug console
- create_console();
+ mIsConsoleAllocated = create_console();
return LLAppViewer::initConsole();
}