Ignore:
Timestamp:
Jul 28, 2010, 3:36:28 PM (14 years ago)
Author:
Torben Dannhauer
Message:

implemented technique to debug memory leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/src/core/visual_core.cpp

    r75 r86  
    1515*/
    1616
     17
    1718#include <visual_core.h>
    1819
     
    2223{
    2324        OSG_NOTIFY( osg::ALWAYS ) << "visual_core instantiated." << std::endl;
     25        #include <leakDetection.h>
     26}
     27
     28visual_core::~visual_core(void)
     29{
     30        // shut osgVisual down
     31        shutdown();
     32
     33        OSG_NOTIFY( osg::ALWAYS ) << "visual_core destroyed." << std::endl;
     34
     35}
     36
     37void visual_core::initialize()
     38{
     39        OSG_NOTIFY( osg::ALWAYS ) << "Initialize visual_core..." << std::endl;
     40
     41        // Configure osg to use KdTrees
     42        osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::ReaderWriter::Options::BUILD_KDTREES);
    2443
    2544        // Setup pathes
     
    3453
    3554        // Test memory leak (todo)
    36         //double* test = new double[1000];
     55        double* test = new double[1000];
    3756
    3857        #ifdef USE_SPACENAVIGATOR
     
    4160
    4261        //osg::DisplaySettings::instance()->setNumOfDatabaseThreadsHint( 8 );
    43 }
    44 
    45 visual_core::~visual_core(void)
    46 {
    47         // shut osgVisual down
    48         shutdown();
    49 
    50         OSG_NOTIFY( osg::ALWAYS ) << "visual_core destroyed." << std::endl;
    51 
    52 }
    53 
    54 void visual_core::initialize()
    55 {
    56         OSG_NOTIFY( osg::ALWAYS ) << "Initialize visual_core..." << std::endl;
    57 
    58         // Load terrain
    59         //loadTerrain(arguments);
    6062
    6163        // Show model
     
    7375#ifdef USE_SKY_SILVERLINING
    7476        // Initialize sky
    75         OSG_NOTIFY( osg::ALWAYS ) << "Using Sky without distortion." << std::endl;
    7677        sky = new visual_skySilverLining( viewer );
    7778        sky->init(distortedSceneGraph, rootNode);       // Without distortedSceneGraph=NULL
     
    156157        }
    157158#endif
     159
     160        // Destroy osgViewer
     161        viewer = NULL;
    158162}
    159163
Note: See TracChangeset for help on using the changeset viewer.