Changeset 87 for osgVisual/src
- Timestamp:
- Jul 28, 2010, 5:13:22 PM (14 years ago)
- Location:
- osgVisual/src
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/src/cluster/dataIO_clusterENet.cpp
r84 r87 22 22 { 23 23 OSG_NOTIFY( osg::ALWAYS ) << "clusterENet constructed" << std::endl; 24 #include <leakDetection.h> 25 24 26 serverToConnect = "unknown"; 25 27 hardSync = false; // integrate into init() -
osgVisual/src/cluster/dataIO_clusterENet_implementation.cpp
r77 r87 25 25 { 26 26 std::cout << "Instantiated server class# "<< activeENetInstances << std::endl; 27 #include <leakDetection.h> 27 28 enetInitialized = false; 28 29 host = NULL; -
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; -
osgVisual/src/core/visual_core.cpp
r86 r87 28 28 visual_core::~visual_core(void) 29 29 { 30 // shut osgVisual down31 shutdown();32 33 30 OSG_NOTIFY( osg::ALWAYS ) << "visual_core destroyed." << std::endl; 34 35 31 } 36 32 … … 49 45 50 46 // Setup coordinate system node 51 rootNode = new osg::CoordinateSystemNode; 47 rootNode = new osg::CoordinateSystemNode; // todo memleakf 52 48 rootNode->setEllipsoidModel(new osg::EllipsoidModel()); 53 49 54 50 // Test memory leak (todo) 55 double* test = new double[1000];51 //double* test = new double[1000]; 56 52 57 53 #ifdef USE_SPACENAVIGATOR … … 130 126 OSG_NOTIFY( osg::ALWAYS ) << "Shutdown visual_core..." << std::endl; 131 127 128 // Shutdown Dbug HUD 129 if(hud.valid()) 130 hud->shutdown(); 132 131 // Unset scene data 133 132 viewer->setSceneData( NULL ); … … 144 143 distortion->shutdown(); 145 144 #endif 145 146 // Shutdown data 147 rootNode = NULL; 146 148 147 149 // Shutdown dataIO … … 295 297 //testObj->addUpdater( new object_updater(testObj) ); 296 298 297 osg::ref_ptr<visual_object> testObj2 = new visual_object( rootNode, "cessna" ); 299 osg::ref_ptr<visual_object> testObj2 = new visual_object( rootNode, "cessna" ); // todo memleak 298 300 //testObj2->setNewPosition( osg::DegreesToRadians(47.8123), osg::DegreesToRadians(12.94088), 600 ); 299 301 testObj2->setNewPosition( osg::DegreesToRadians(50.8123), osg::DegreesToRadians(8.94088), 600 ); 300 302 testObj2->loadGeometry( "../models/cessna.osg" ); 301 testObj2->addUpdater( new object_updater(testObj2) ); 302 303 osg::ref_ptr<visual_object> testObj3 = new visual_object( rootNode, "SAENGER1" ); 303 testObj2->addUpdater( new object_updater(testObj2) ); // todo memleak 304 305 osg::ref_ptr<visual_object> testObj3 = new visual_object( rootNode, "SAENGER1" ); // todo memleak 304 306 testObj3->setNewPosition( osg::DegreesToRadians(47.8123), osg::DegreesToRadians(12.94088), 600 ); 305 307 testObj3->loadGeometry( "../models/saenger1.flt" ); 306 testObj3->addUpdater( new object_updater(testObj3) ); 307 308 309 osg::ref_ptr<visual_object> testObj4 = new visual_object( rootNode, "SAENGER2" ); 308 testObj3->addUpdater( new object_updater(testObj3) ); // todo memleak 309 310 311 osg::ref_ptr<visual_object> testObj4 = new visual_object( rootNode, "SAENGER2" ); // todo memleak 310 312 testObj4->setNewPosition( osg::DegreesToRadians(47.8123), osg::DegreesToRadians(12.94088), 650 ); 311 313 testObj4->loadGeometry( "../models/saenger2.flt" ); 312 testObj4->addUpdater( new object_updater(testObj4) ); 314 testObj4->addUpdater( new object_updater(testObj4) ); // todo memleak 313 315 testObj4->addLabel("testLabel", "LabelTest!!\nnächste Zeile :)",osg::Vec4(1.0f,0.25f,1.0f,1.0f)); 314 316 315 osg::ref_ptr<visual_object> testObj5 = new visual_object( rootNode, "SAENGER" ); 317 osg::ref_ptr<visual_object> testObj5 = new visual_object( rootNode, "SAENGER" ); // todo memleak 316 318 testObj5->setNewPosition( osg::DegreesToRadians(47.8123), osg::DegreesToRadians(12.94088), 550 ); 317 319 testObj5->loadGeometry( "../models/saengerCombine.flt" ); 318 320 //testObj5->setScale( 2 ); 319 testObj5->addUpdater( new object_updater(testObj5) ); 321 testObj5->addUpdater( new object_updater(testObj5) ); // todo memleak 320 322 321 323 #ifdef USE_SPACENAVIGATOR … … 359 361 visual_draw2D::getInstance()->init( rootNode, viewer ); 360 362 //osg::ref_ptr<visual_hud> hud = new visual_hud(); 361 osg::ref_ptr<visual_debug_hud>hud = new visual_debug_hud();363 hud = new visual_debug_hud(); 362 364 hud->init( viewer, rootNode ); 363 365 -
osgVisual/src/dataIO/visual_dataIO.cpp
r84 r87 22 22 { 23 23 OSG_NOTIFY( osg::ALWAYS ) << "visual_dataIO constructed" << std::endl; 24 24 #include <leakDetection.h> 25 25 initialized = false; 26 26 } -
osgVisual/src/distortion/visual_distortion.cpp
r70 r87 22 22 { 23 23 OSG_NOTIFY (osg::ALWAYS ) << "visual_distortion instantiated." << std::endl; 24 #include <leakDetection.h> 24 25 25 26 initialized = false; -
osgVisual/src/draw2D/visual_debug_hud.cpp
r31 r87 21 21 visual_debug_hud::visual_debug_hud(void) 22 22 { 23 23 #include <leakDetection.h> 24 24 } 25 25 … … 51 51 if (isInitialized) 52 52 { 53 // Remove Draw Content 54 visual_draw2D::getInstance()->removeDrawContent("HUD"); 55 53 56 // Remove updatecallback 54 this->remove UpdateCallback( updateCallback );57 this->removeEventCallback( updateCallback ); 55 58 updateCallback = NULL; 56 59 } -
osgVisual/src/draw2D/visual_draw2D.cpp
r31 r87 22 22 { 23 23 OSG_NOTIFY( osg::ALWAYS ) << "visual_draw2D constructed" << std::endl; 24 #include <leakDetection.h> 24 25 initialized = false; 25 26 } -
osgVisual/src/draw2D/visual_hud.cpp
r31 r87 21 21 visual_hud::visual_hud(void) 22 22 { 23 #include <leakDetection.h> 23 24 } 24 25 -
osgVisual/src/draw3D/visual_draw3D.cpp
r31 r87 21 21 visual_draw3D::visual_draw3D(void) 22 22 { 23 #include <leakDetection.h> 23 24 } 24 25 -
osgVisual/src/extLink/dataIO_extLinkVCL.cpp
r57 r87 24 24 { 25 25 OSG_NOTIFY( osg::ALWAYS ) << "extLinkVCL constructed" << std::endl; 26 #include <leakDetection.h> 26 27 } 27 28 -
osgVisual/src/extLink/manip_extLink.cpp
r31 r87 24 24 extLinkManipulator::extLinkManipulator() 25 25 { 26 #include <leakDetection.h> 26 27 } 27 28 -
osgVisual/src/manip_ObjectMounted/manip_objectMounted.cpp
r31 r87 25 25 objectMountedManipulator::objectMountedManipulator() 26 26 { 27 #include <leakDetection.h> 27 28 } 28 29 -
osgVisual/src/manip_Spacemouse/manip_freeSpaceMouse.cpp
r31 r87 25 25 FreeManipulator::FreeManipulator(SpaceMouse* spacemouse) : _spaceMouse(spacemouse) 26 26 { 27 #include <leakDetection.h> 27 28 } 28 29 -
osgVisual/src/manip_Spacemouse/manip_nodeTrackerSpaceMouse.cpp
r31 r87 25 25 NodeTrackerSpaceMouse::NodeTrackerSpaceMouse(SpaceMouse* spacemouse) : _spaceMouse(spacemouse) 26 26 { 27 #include <leakDetection.h> 27 28 _trackerMode = NODE_CENTER_AND_ROTATION; 28 29 _rotationMode = TRACKBALL; -
osgVisual/src/manip_Spacemouse/manip_spaceMouse.cpp
r55 r87 168 168 SpaceMouse::SpaceMouse() : _spaceMouseImpl(new SpaceMouseImpl) 169 169 { 170 #include <leakDetection.h> 170 171 } 171 172 -
osgVisual/src/object/object_updater.cpp
r31 r87 21 21 object_updater::object_updater(osgVisual::visual_object* object_ ) 22 22 { 23 #include <leakDetection.h> 23 24 } 24 25 -
osgVisual/src/object/visual_object.cpp
r36 r87 21 21 visual_object::visual_object( osg::CoordinateSystemNode* sceneRoot_, std::string nodeName_) 22 22 { 23 #include <leakDetection.h> 24 23 25 // Add this node to Scenegraph 24 26 sceneRoot_->addChild( this ); -
osgVisual/src/sky_Silverlining/skySilverLining_cloudsDrawable.cpp
r31 r87 33 33 : osg::Drawable() 34 34 { 35 #include <leakDetection.h> 35 36 setDataVariance(osg::Object::DYNAMIC); 36 37 setUseVertexBufferObjects(false); -
osgVisual/src/sky_Silverlining/skySilverLining_skyDrawable.cpp
r55 r87 36 36 , _skyboxSize(0) 37 37 { 38 #include <leakDetection.h> 39 38 40 setDataVariance(osg::Object::DYNAMIC); 39 41 setUseVertexBufferObjects(false); -
osgVisual/src/sky_Silverlining/visual_skySilverLining.cpp
r73 r87 21 21 visual_skySilverLining::visual_skySilverLining(osgViewer::Viewer* viewer_) 22 22 { 23 OSG_NOTIFY( osg::ALWAYS ) << "Initialize visual_skySilverlining..." << std::endl; 24 #include <leakDetection.h> 25 23 26 atmosphereInitialized = false; 24 27 postInitialized = false;
Note: See TracChangeset
for help on using the changeset viewer.