diff options
author | Jacek Antonelli | 2008-09-12 14:59:33 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-12 14:59:39 -0500 |
commit | 80a8bab2a9dd8e77262b001af973212a6cba4a5a (patch) | |
tree | 170168232fd4e2eec5f15295a9445535969cdb76 /linden/indra/newview/llappviewerwin32.cpp | |
parent | Second Life viewer sources 1.21.1-RC (diff) | |
download | meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.zip meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.tar.gz meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.tar.bz2 meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.tar.xz |
Second Life viewer sources 1.21.2-RC
Diffstat (limited to 'linden/indra/newview/llappviewerwin32.cpp')
-rw-r--r-- | linden/indra/newview/llappviewerwin32.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/linden/indra/newview/llappviewerwin32.cpp b/linden/indra/newview/llappviewerwin32.cpp index aab6289..07f3ece 100644 --- a/linden/indra/newview/llappviewerwin32.cpp +++ b/linden/indra/newview/llappviewerwin32.cpp | |||
@@ -31,6 +31,10 @@ | |||
31 | 31 | ||
32 | #include "llviewerprecompiledheaders.h" | 32 | #include "llviewerprecompiledheaders.h" |
33 | 33 | ||
34 | #if defined(_DEBUG) | ||
35 | # define WINDOWS_CRT_MEM_CHECKS 1 | ||
36 | #endif | ||
37 | |||
34 | #include "llappviewerwin32.h" | 38 | #include "llappviewerwin32.h" |
35 | 39 | ||
36 | #include "llmemtype.h" | 40 | #include "llmemtype.h" |
@@ -127,6 +131,10 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, | |||
127 | { | 131 | { |
128 | LLMemType mt1(LLMemType::MTYPE_STARTUP); | 132 | LLMemType mt1(LLMemType::MTYPE_STARTUP); |
129 | 133 | ||
134 | #if WINDOWS_CRT_MEM_CHECKS && !INCLUDE_VLD | ||
135 | _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); // dump memory leaks on exit | ||
136 | #endif | ||
137 | |||
130 | // *FIX: global | 138 | // *FIX: global |
131 | gIconResource = MAKEINTRESOURCE(IDI_LL_ICON); | 139 | gIconResource = MAKEINTRESOURCE(IDI_LL_ICON); |
132 | 140 | ||
@@ -156,7 +164,32 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, | |||
156 | // the assumption is that the error handler is responsible for doing | 164 | // the assumption is that the error handler is responsible for doing |
157 | // app cleanup if there was a problem. | 165 | // app cleanup if there was a problem. |
158 | // | 166 | // |
159 | viewer_app_ptr->cleanup(); | 167 | #if WINDOWS_CRT_MEM_CHECKS |
168 | llinfos << "CRT Checking memory:" << llendflush; | ||
169 | if (!_CrtCheckMemory()) | ||
170 | { | ||
171 | llwarns << "_CrtCheckMemory() failed at prior to cleanup!" << llendflush; | ||
172 | } | ||
173 | else | ||
174 | { | ||
175 | llinfos << " No corruption detected." << llendflush; | ||
176 | } | ||
177 | #endif | ||
178 | |||
179 | viewer_app_ptr->cleanup(); | ||
180 | |||
181 | #if WINDOWS_CRT_MEM_CHECKS | ||
182 | llinfos << "CRT Checking memory:" << llendflush; | ||
183 | if (!_CrtCheckMemory()) | ||
184 | { | ||
185 | llwarns << "_CrtCheckMemory() failed after cleanup!" << llendflush; | ||
186 | } | ||
187 | else | ||
188 | { | ||
189 | llinfos << " No corruption detected." << llendflush; | ||
190 | } | ||
191 | #endif | ||
192 | |||
160 | } | 193 | } |
161 | delete viewer_app_ptr; | 194 | delete viewer_app_ptr; |
162 | viewer_app_ptr = NULL; | 195 | viewer_app_ptr = NULL; |