Skip to content

Commit 31f3a5c

Browse files
authored
fix(debug): Fix Release debug logging in tools (#1397)
1 parent e06f598 commit 31f3a5c

File tree

6 files changed

+9
-24
lines changed

6 files changed

+9
-24
lines changed

Core/Tools/ImagePacker/Source/WinMain.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
8484
LPSTR lpCmdLine, Int nCmdShow )
8585
{
8686

87-
// start the log
88-
DEBUG_INIT(DEBUG_FLAGS_DEFAULT);
87+
// initialize the memory manager early
8988
initMemoryManager();
9089

9190
// save application instance
@@ -114,9 +113,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
114113
delete TheImagePacker;
115114
TheImagePacker = NULL;
116115

117-
// close the log
118116
shutdownMemoryManager();
119-
DEBUG_SHUTDOWN();
120117

121118
// all done
122119
return 0;

Core/Tools/MapCacheBuilder/Source/WinMain.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
212212
LPSTR lpCmdLine, Int nCmdShow )
213213
{
214214

215-
// start the log
216-
DEBUG_INIT(DEBUG_FLAGS_DEFAULT);
215+
// initialize the memory manager early
217216
initMemoryManager();
218217

219218
try
@@ -325,9 +324,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
325324
DEBUG_CRASH(("Munkee munkee!"));
326325
}
327326

328-
// close the log
329327
shutdownMemoryManager();
330-
DEBUG_SHUTDOWN();
331328

332329
// all done
333330
return 0;

Generals/Code/Tools/GUIEdit/Source/WinMain.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ Int APIENTRY WinMain(HINSTANCE hInstance,
199199
}
200200
::SetCurrentDirectory(buffer);
201201

202-
// start the log
203-
DEBUG_INIT(DEBUG_FLAGS_DEFAULT);
202+
// initialize the memory manager early
204203
initMemoryManager();
205204

206205
// register a class for our window with the OS
@@ -275,9 +274,7 @@ Int APIENTRY WinMain(HINSTANCE hInstance,
275274
delete TheEditor;
276275
TheEditor = NULL;
277276

278-
// close the log
279277
shutdownMemoryManager();
280-
DEBUG_SHUTDOWN();
281278

282279
return msg.wParam;
283280

Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,13 @@ BOOL CWorldBuilderApp::InitInstance()
274274
// initialization
275275
_set_se_translator( DumpExceptionInfo ); // Hook that allows stack trace.
276276

277-
// start the log
278-
DEBUG_INIT(DEBUG_FLAGS_DEFAULT);
277+
// initialize the memory manager early
278+
initMemoryManager();
279+
279280
DEBUG_LOG(("starting Worldbuilder."));
280281
#ifdef RTS_DEBUG
281282
DEBUG_LOG(("RTS_DEBUG defined."));
282283
#endif
283-
initMemoryManager();
284284
#ifdef MEMORYPOOL_CHECKPOINTING
285285
gFirstCP = TheMemoryPoolFactory->debugSetCheckpoint();
286286
#endif
@@ -644,7 +644,6 @@ int CWorldBuilderApp::ExitInstance()
644644
TheMemoryPoolFactory->debugMemoryReport(REPORT_FACTORYINFO | REPORT_CP_LEAKS | REPORT_CP_STACKTRACE, gFirstCP, lastCP);
645645
#endif
646646
shutdownMemoryManager();
647-
DEBUG_SHUTDOWN();
648647

649648
return CWinApp::ExitInstance();
650649
}

GeneralsMD/Code/Tools/GUIEdit/Source/WinMain.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ Int APIENTRY WinMain(HINSTANCE hInstance,
199199
}
200200
::SetCurrentDirectory(buffer);
201201

202-
// start the log
203-
DEBUG_INIT(DEBUG_FLAGS_DEFAULT);
202+
// initialize the memory manager early
204203
initMemoryManager();
205204

206205
// register a class for our window with the OS
@@ -275,9 +274,7 @@ Int APIENTRY WinMain(HINSTANCE hInstance,
275274
delete TheEditor;
276275
TheEditor = NULL;
277276

278-
// close the log
279277
shutdownMemoryManager();
280-
DEBUG_SHUTDOWN();
281278

282279
return msg.wParam;
283280

GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ BOOL CWorldBuilderApp::InitInstance()
280280
// initialization
281281
_set_se_translator( DumpExceptionInfo ); // Hook that allows stack trace.
282282

283-
// start the log
284-
DEBUG_INIT(DEBUG_FLAGS_DEFAULT);
283+
// initialize the memory manager early
284+
initMemoryManager();
285285

286286
#ifdef DEBUG_LOGGING
287287
// Turn on console output jba [3/20/2003]
@@ -293,7 +293,6 @@ BOOL CWorldBuilderApp::InitInstance()
293293
#ifdef RTS_DEBUG
294294
DEBUG_LOG(("RTS_DEBUG defined."));
295295
#endif
296-
initMemoryManager();
297296
#ifdef MEMORYPOOL_CHECKPOINTING
298297
gFirstCP = TheMemoryPoolFactory->debugSetCheckpoint();
299298
#endif
@@ -667,7 +666,6 @@ int CWorldBuilderApp::ExitInstance()
667666
TheMemoryPoolFactory->debugMemoryReport(REPORT_POOLINFO | REPORT_POOL_OVERFLOW | REPORT_SIMPLE_LEAKS, 0, 0);
668667
#endif
669668
shutdownMemoryManager();
670-
DEBUG_SHUTDOWN();
671669

672670
return CWinApp::ExitInstance();
673671
}

0 commit comments

Comments
 (0)