Changeset 87 for osgVisual/src/core/osgVisual.cpp
- Timestamp:
- Jul 28, 2010, 5:13:22 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/src/core/osgVisual.cpp
r86 r87 15 15 */ 16 16 17 // Declare this in header. 17 const unsigned int MAX_NUM_EVENTS = 10; 18 19 #ifdef _DEBUG 20 #ifdef WIN32 21 // Declare this in header. 22 #define _CRTDBG_MAP_ALLOC 23 #include <stdlib.h> 24 #include <crtdbg.h> 25 #endif 26 #endif 27 18 28 //#include <windows.h> 19 #define _CRTDBG_MAP_ALLOC20 #include <crtdbg.h>21 29 22 30 #include <osg/ArgumentParser> … … 26 34 #include <visual_core.h> 27 35 28 const unsigned int MAX_NUM_EVENTS = 10; 36 29 37 30 38 … … 33 41 34 42 #ifdef _DEBUG 35 #include <leakDetection.h> // ugly but must be included inside the class 43 #ifdef WIN32 44 #include <leakDetection.h> // ugly but must be included inside the class 36 45 37 46 int tmp_flag; 38 47 39 40 48 HANDLE log_file = CreateFile("mem_log.txt", GENERIC_WRITE,FILE_SHARE_WRITE, 49 NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); 41 50 42 43 44 45 46 51 _CrtSetReportMode(_CRT_ASSERT,_CRTDBG_MODE_FILE | _CRTDBG_MODE_WNDW | 52 _CRTDBG_MODE_DEBUG); 53 _CrtSetReportMode(_CRT_WARN,_CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); 54 _CrtSetReportMode(_CRT_ERROR,_CRTDBG_MODE_FILE | _CRTDBG_MODE_WNDW | 55 _CRTDBG_MODE_DEBUG); 47 56 48 49 50 51 57 // output to the file if not under VS 58 _CrtSetReportFile(_CRT_ASSERT, log_file); 59 _CrtSetReportFile(_CRT_WARN, log_file); 60 _CrtSetReportFile(_CRT_ERROR, log_file); 52 61 53 54 55 56 62 tmp_flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); 63 tmp_flag |= _CRTDBG_ALLOC_MEM_DF; 64 tmp_flag |= _CRTDBG_DELAY_FREE_MEM_DF; 65 tmp_flag |= _CRTDBG_LEAK_CHECK_DF; 57 66 58 _CrtSetDbgFlag(tmp_flag); 67 _CrtSetDbgFlag(tmp_flag); 68 #endif 59 69 #endif 60 70 … … 68 78 core->initialize(); 69 79 80 // Shut osgVisual down 81 core->shutdown(); 82 70 83 // Set Pointer to null to destroy the objects before this function ends - otherwise memory leaks wil be detected. 71 84 core = NULL;
Note: See TracChangeset
for help on using the changeset viewer.