Code: Show/Hide // Where your DLL is loaded, call these:
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); // Then where you want to check for a memory leak, see if there are memory leaks and dump results into the console: _CrtDumpMemoryLeaks( ); |
Quote: |
Radon711 Ext: DLL plugin disconnected.
Detected memory leaks! Dumping objects -> {38} normal block at 0x00E70050, 12 bytes long. Data: < > F0 0E E7 00 00 00 00 00 00 00 00 00 {37} normal block at 0x00E70EF0, 88 bytes long. Data: < > 00 CD CD CD 00 00 00 00 00 00 00 00 00 00 00 00 Object dump complete. |
Code: Show/Hide #define DEBUG_NEW(x) printf("allocation: %s %d 0x%p\n", __FILE__, __LINE__, x) |
Code: Show/Hide struct PlayerTag
{ Player *p; char name[20]; int index; int data; }; struct OffenseTag { Player *killer; Player *killed; int time; int id; }; |
Quote: |
Radon711 Got synchronization packet [1778400][1804605582]
Radon711 P:CypherJF> .load ctkwatch allocation: C:\Projects\B45\cTKWatch\SPAWN.CPP 483 0x00C70EF0 bot = new botInfo(event.handle); Radon711 Ext: DLL plugin connected. allocation: C:\Projects\B45\cTKWatch\SPAWN.CPP 279 0x00C70E70 OffenseTag *ot = new OffenseTag(); Radon711 P:CypherJF> .tk 1 allocation: C:\Projects\B45\cTKWatch\SPAWN.CPP 534 0x00C70D40 Player *tag = new PlayerTag; Radon711 A:Player warned Radon711 P:CypherJF> .unload 0 Radon711 Ext: DLL plugin disconnected. Detected memory leaks! Dumping objects -> {40} normal block at 0x00C70EB0, 12 bytes long. Data: < > F0 0E C7 00 00 00 00 00 00 00 00 00 {37} normal block at 0x00C70EF0, 88 bytes long. Data: < > 00 CD CD CD 00 00 00 00 00 00 00 00 00 00 00 00 Object dump complete. |
Cyan~Fire wrote: |
Ok. There are no leaks in the core. (Or at least none that the CRT detected.) |
Code: Show/Hide int _cdecl main(int argc, char *argv[]) { /* argv[0] Commandline to exe argv[1] First argument */ _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); //... _CrtDumpMemoryLeaks( ); system("PAUSE"); return 0; } |
Code: Show/Hide // Create bot database
BOT_DATABASE botDatabase; |