summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewerwin32.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-09-12 06:27:13 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-09-12 06:27:13 +0000
commitda94c0eaa2ce2711f0ae26968e87ef3e409126a9 (patch)
treee0b23896f17e0a0ea60160b2c7e39331f3cb9668 /indra/newview/llappviewerwin32.cpp
parent642cdd95726755b7c24c7f2b25e2fea8e49b5b9b (diff)
QAR-855 Viewer 1.21 RC 2
merge viewer_1-21 94770-96059 -> release
Diffstat (limited to 'indra/newview/llappviewerwin32.cpp')
-rw-r--r--indra/newview/llappviewerwin32.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 1d8f6a218c..a25b86467d 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -31,6 +31,10 @@
#include "llviewerprecompiledheaders.h"
+#if defined(_DEBUG)
+# define WINDOWS_CRT_MEM_CHECKS 1
+#endif
+
#include "llappviewerwin32.h"
#include "llmemtype.h"
@@ -127,6 +131,10 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
{
LLMemType mt1(LLMemType::MTYPE_STARTUP);
+#if WINDOWS_CRT_MEM_CHECKS && !INCLUDE_VLD
+ _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); // dump memory leaks on exit
+#endif
+
// *FIX: global
gIconResource = MAKEINTRESOURCE(IDI_LL_ICON);
@@ -156,7 +164,32 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
// the assumption is that the error handler is responsible for doing
// app cleanup if there was a problem.
//
- viewer_app_ptr->cleanup();
+#if WINDOWS_CRT_MEM_CHECKS
+ llinfos << "CRT Checking memory:" << llendflush;
+ if (!_CrtCheckMemory())
+ {
+ llwarns << "_CrtCheckMemory() failed at prior to cleanup!" << llendflush;
+ }
+ else
+ {
+ llinfos << " No corruption detected." << llendflush;
+ }
+#endif
+
+ viewer_app_ptr->cleanup();
+
+#if WINDOWS_CRT_MEM_CHECKS
+ llinfos << "CRT Checking memory:" << llendflush;
+ if (!_CrtCheckMemory())
+ {
+ llwarns << "_CrtCheckMemory() failed after cleanup!" << llendflush;
+ }
+ else
+ {
+ llinfos << " No corruption detected." << llendflush;
+ }
+#endif
+
}
delete viewer_app_ptr;
viewer_app_ptr = NULL;