Changeset 88


Ignore:
Timestamp:
Jul 29, 2010, 8:39:55 AM (14 years ago)
Author:
Torben Dannhauer
Message:

Moved memory leak detection from source file to headerfile. Its still in the class but at least not in the source file.

The leak detection works, but the false positives are not stopped.
Use Linux/Valgrind? to make your final leak detection beyond the easy first approach in MSVC

Location:
osgVisual
Files:
50 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/CMakeLists.txt

    r86 r88  
    9595        ENDIF(USE_SKY_SILVERLINING)
    9696ENDIF(WIN32)
    97 
     97IF(CMAKE_COMPILER_IS_GNUCC)
     98       
     99        SET(USE_SKY_SILVERLINING ON CACHE BOOL "Enable to use Sundog-soft's Silverlining SDK for sky & weather")
     100        IF(USE_SKY_SILVERLINING )
     101                SET(SOURCES
     102                        ${SOURCES}
     103                        include/sky_Silverlining/skySilverLining_AtmosphereReference.h
     104                        include/sky_Silverlining/skySilverlining_cloudLayerSlot.h
     105                        include/sky_Silverlining/skySilverLining_cloudsDrawable.h
     106                        include/sky_Silverlining/skySilverLining_ProjectionMatrixCallback.h
     107                        include/sky_Silverlining/skySilverLining_skyDrawable.h
     108                        include/sky_Silverlining/visual_skySilverLining.h
     109                        src/sky_Silverlining/skySilverLining_cloudsDrawable.cpp
     110                        src/sky_Silverlining/skySilverLining_skyDrawable.cpp
     111                        src/sky_Silverlining/visual_skySilverLining.cpp                 
     112                )
     113               
     114                IF (DESTINATION_ARCH STREQUAL "x86")
     115                        SET(SILVERLINING_ARCH "win32")
     116                ELSEIF ( DESTINATION_ARCH STREQUAL "x64" )
     117                        SET(SILVERLINING_ARCH "x64")
     118                ENDIF ()
     119                SET(SILVERLINING_LIBRARY_RELEASE $ENV{SILVERLINING_PATH}\\lib\\vc9\\${SILVERLINING_ARCH}\\SilverLining-MT-DLL.lib CACHE FILEPATH "Select the release library of Sundog-Soft's Silverlining SDK to link against." )
     120                SET(SILVERLINING_LIBRARY_DEBUG $ENV{SILVERLINING_PATH}\\lib\\vc9\\${SILVERLINING_ARCH}\\SilverLining-MTD-DLL.lib CACHE FILEPATH "Select the debug library of Sundog-Soft's Silverlining SDK to link against." )
     121                SET(SILVERLINING_INCLUDE_DIR "$ENV{SILVERLINING_PATH}\\Public Headers" CACHE PATH "Enter the path to the the public Include directory of Sundog-Soft's Silverlining SDK" )
     122                SET(SILVERLINING_LICENSEE "Your user name" CACHE STRING "Enter your Silverlining licensee name. If you license available, osgVisual will work with silverlining as 5 minute demo with the default value." )
     123                SET(SILVERLINING_LICENSE "Your license code" CACHE STRING "Enter your Silverlining license key. If you license available, osgVisual will work with silverlining as 5 minute demo with the default value." )
     124                INCLUDE_DIRECTORIES(${SILVERLINING_INCLUDE_DIR} include/sky_Silverlining)
     125                ADD_DEFINITIONS( "-DUSE_SKY_SILVERLINING" )
     126                ADD_DEFINITIONS( "-DSILVERLINING_LICENSEE=\"${SILVERLINING_LICENSEE}\"" )
     127                ADD_DEFINITIONS( "-DSILVERLINING_LICENSE=\"${SILVERLINING_LICENSE}\"" )
     128               
     129        ELSE(USE_SKY_SILVERLINING)
     130                UNSET(SILVERLINING_LIBRARY_RELEASE CACHE)
     131                UNSET(SILVERLINING_LIBRARY_DEBUG CACHE)
     132                UNSET(SILVERLINING_INCLUDE_DIR CACHE)
     133                UNSET(SILVERLINING_LICENSEE)
     134                UNSET(SILVERLINING_LICENSE)
     135        ENDIF(USE_SKY_SILVERLINING)
     136ENDIF()
    98137
    99138# Module distortion
  • osgVisual/include/cluster/dataIO_cluster.h

    r81 r88  
    3737class dataIO_cluster :  public osg::Referenced
    3838{
     39        #include <leakDetection.h>
    3940public:
    4041        /**
  • osgVisual/include/cluster/dataIO_clusterENet.h

    r81 r88  
    3939class dataIO_clusterENet :      public dataIO_cluster
    4040{
     41        #include <leakDetection.h>
    4142public:
    4243        dataIO_clusterENet();
  • osgVisual/include/cluster/dataIO_clusterENet_implementation.h

    r80 r88  
    3838class dataIO_clusterENet_implementation :       public osg::Referenced
    3939{
     40        #include <leakDetection.h>
    4041public:
    4142        /**
  • osgVisual/include/core/visual_core.h

    r87 r88  
    9292class visual_core : public osg::Referenced
    9393{
     94        #include <leakDetection.h>
     95
    9496public:
    9597        visual_core(osg::ArgumentParser& arguments_);
  • osgVisual/include/dataIO/dataIO_executer.h

    r32 r88  
    2727class dataIO_executer : public osg::Node
    2828{
     29        #include <leakDetection.h>
    2930public:
    3031        dataIO_executer() {id=DO_NOTHING;}
  • osgVisual/include/dataIO/dataIO_slot.h

    r32 r88  
    2828class dataIO_slot : public osg::Object
    2929{
     30        #include <leakDetection.h>
    3031public:
    3132        META_Object(osgVisual,dataIO_slot);
  • osgVisual/include/dataIO/dataIO_transportContainer.h

    r75 r88  
    2929class dataIO_transportContainer : public osg::Object
    3030{
     31        #include <leakDetection.h>
    3132public:
    3233        META_Object(osgVisual,dataIO_transportContainer);       // Required for serializer
  • osgVisual/include/dataIO/visual_dataIO.h

    r86 r88  
    6565class visual_dataIO : public osg::Referenced
    6666{
     67        #include <leakDetection.h>
    6768private:
    6869        class dataIO_eventCallback : public osg::NodeCallback
  • osgVisual/include/distortion/visual_distortion.h

    r32 r88  
    5454class visual_distortion : public osg::Node
    5555{
     56        #include <leakDetection.h>
    5657public:
    5758        /**
  • osgVisual/include/draw2D/visual_debug_hud.h

    r32 r88  
    3838class visual_debug_hud : public osg::Geode
    3939{
     40        #include <leakDetection.h>
    4041public:
    4142        /**
  • osgVisual/include/draw2D/visual_draw2D.h

    r32 r88  
    2929namespace osgVisual
    3030{
     31        #include <leakDetection.h>
    3132
    3233/**
  • osgVisual/include/draw2D/visual_hud.h

    r32 r88  
    3434class visual_hud : public osg::Geode
    3535{
     36        #include <leakDetection.h>
    3637public:
    3738        /**
  • osgVisual/include/draw3D/visual_draw3D.h

    r32 r88  
    2828class visual_draw3D : public osg::Node
    2929{
     30        #include <leakDetection.h>
    3031public:
    3132        visual_draw3D(void);
  • osgVisual/include/extLink/dataIO_extLink.h

    r32 r88  
    3535class dataIO_extLink : public osg::Referenced
    3636{
     37        #include <leakDetection.h>
    3738public:
    3839        /**
  • osgVisual/include/extLink/dataIO_extLinkVCL.h

    r50 r88  
    6666class dataIO_extLinkVCL :       public dataIO_extLink
    6767{
     68#include <leakDetection.h>
    6869public:
    6970        dataIO_extLinkVCL(std::vector<dataIO_slot>& dataSlots_);
  • osgVisual/include/extLink/manip_extLink.h

    r73 r88  
    3131class extLinkManipulator : public osgGA::CameraManipulator
    3232{
     33        #include <leakDetection.h>
    3334    public:
    3435                /**
  • osgVisual/include/manip_ObjectMounted/manip_objectMounted.h

    r55 r88  
    3535class objectMountedManipulator : public osgGA::CameraManipulator
    3636{
     37        #include <leakDetection.h>
    3738    public:
    3839                /**
  • osgVisual/include/manip_Spacemouse/manip_freeSpaceMouse.h

    r55 r88  
    4141class FreeManipulator : public osgGA::CameraManipulator
    4242{
     43        #include <leakDetection.h>
    4344    public:
    4445                /**
  • osgVisual/include/manip_Spacemouse/manip_nodeTrackerSpaceMouse.h

    r55 r88  
    5151class NodeTrackerSpaceMouse : public osgGA::OrbitManipulator
    5252{
     53        #include <leakDetection.h>
    5354    public:
    5455                /**
  • osgVisual/include/object/object_updater.h

    r32 r88  
    4040class object_updater : public osg::Node
    4141{
     42        #include <leakDetection.h>
    4243public:
    4344        /**
  • osgVisual/include/object/visual_object.h

    r55 r88  
    6868class visual_object  : public osg::MatrixTransform
    6969{
     70        #include <leakDetection.h>
    7071public:
    7172        /**
  • osgVisual/include/sky_Silverlining/skySilverLining_AtmosphereReference.h

    r32 r88  
    3737class skySilverLining_atmosphereReference : public osg::Referenced
    3838{
     39        #include <leakDetection.h>
    3940public:
    4041        /**
  • osgVisual/include/sky_Silverlining/skySilverLining_ProjectionMatrixCallback.h

    r87 r88  
    4242class skySilverLining_projectionMatrixCallback : public osg::CullSettings::ClampProjectionMatrixCallback
    4343{
     44        #include <leakDetection.h>
    4445public:
    4546        /**
  • osgVisual/include/sky_Silverlining/skySilverLining_cloudsDrawable.h

    r32 r88  
    3737class skySilverLining_cloudsDrawable : public osg::Drawable
    3838{
     39        #include <leakDetection.h>
    3940public:
    4041        /**
  • osgVisual/include/sky_Silverlining/skySilverLining_skyDrawable.h

    r53 r88  
    4141class skySilverLining_skyDrawable : public osg::Drawable
    4242{
     43        #include <leakDetection.h>
    4344public:
    4445        skySilverLining_skyDrawable();
  • osgVisual/include/sky_Silverlining/skySilverlining_cloudLayerSlot.h

    r32 r88  
    3434class cloudLayerSlot
    3535{
     36        #include <leakDetection.h>
    3637public:
    3738        /**
  • osgVisual/include/sky_Silverlining/visual_skySilverLining.h

    r70 r88  
    5656class visual_skySilverLining : public osg::Geode
    5757{
     58        #include <leakDetection.h>
    5859public:
    5960        /**
  • osgVisual/include/util/visual_util.h

    r32 r88  
    5555class util
    5656{
     57        #include <leakDetection.h>
    5758public:
    5859        /**
  • osgVisual/src/cluster/dataIO_clusterENet.cpp

    r87 r88  
    2222{
    2323        OSG_NOTIFY( osg::ALWAYS ) << "clusterENet constructed" << std::endl;
    24         #include <leakDetection.h>
    2524
    2625        serverToConnect = "unknown";
  • osgVisual/src/cluster/dataIO_clusterENet_implementation.cpp

    r87 r88  
    2525{
    2626        std::cout << "Instantiated server class# "<< activeENetInstances << std::endl;
    27         #include <leakDetection.h>
     27
    2828        enetInitialized = false;
    2929        host = NULL;
  • osgVisual/src/core/osgVisual.cpp

    r87 r88  
    2626#endif
    2727
     28
    2829//#include <windows.h>
    2930
     
    4243#ifdef _DEBUG
    4344        #ifdef WIN32
    44                 #include <leakDetection.h>      // ugly but must be included inside the class
    45 
     45                #include <leakDetection.h>      // for main: must be inside function. In classes: headerfile inside calss is sufficient
    4646                int tmp_flag;
    4747
     
    5555                        _CRTDBG_MODE_DEBUG);
    5656
    57                 // output to the file if not under VS
     57                // output to the file
    5858                _CrtSetReportFile(_CRT_ASSERT, log_file);
    5959                _CrtSetReportFile(_CRT_WARN, log_file);
  • osgVisual/src/core/visual_core.cpp

    r87 r88  
    2323{
    2424        OSG_NOTIFY( osg::ALWAYS ) << "visual_core instantiated." << std::endl;
    25         #include <leakDetection.h>
    2625}
    2726
     
    4948
    5049        // Test memory leak (todo)
    51         //double* test = new double[1000];
     50        double* test = new double[1000];
    5251
    5352        #ifdef USE_SPACENAVIGATOR
  • osgVisual/src/dataIO/visual_dataIO.cpp

    r87 r88  
    2222{
    2323        OSG_NOTIFY( osg::ALWAYS ) << "visual_dataIO constructed" << std::endl;
    24         #include <leakDetection.h>
     24
    2525        initialized = false;
    2626}
  • osgVisual/src/distortion/visual_distortion.cpp

    r87 r88  
    2222{
    2323        OSG_NOTIFY (osg::ALWAYS ) << "visual_distortion instantiated." << std::endl;
    24         #include <leakDetection.h>
    2524
    2625        initialized = false;
  • osgVisual/src/draw2D/visual_debug_hud.cpp

    r87 r88  
    2121visual_debug_hud::visual_debug_hud(void)
    2222{
    23         #include <leakDetection.h>
    2423}
    2524
  • osgVisual/src/draw2D/visual_draw2D.cpp

    r87 r88  
    2222{
    2323        OSG_NOTIFY( osg::ALWAYS ) << "visual_draw2D constructed" << std::endl;
    24         #include <leakDetection.h>
    2524        initialized = false;
    2625}
  • osgVisual/src/draw2D/visual_hud.cpp

    r87 r88  
    2121visual_hud::visual_hud(void)
    2222{
    23         #include <leakDetection.h>
    2423}
    2524
  • osgVisual/src/draw3D/visual_draw3D.cpp

    r87 r88  
    2121visual_draw3D::visual_draw3D(void)
    2222{
    23         #include <leakDetection.h>
    2423}
    2524
  • osgVisual/src/extLink/dataIO_extLinkVCL.cpp

    r87 r88  
    2424{
    2525        OSG_NOTIFY( osg::ALWAYS ) << "extLinkVCL constructed" << std::endl;
    26         #include <leakDetection.h>
    2726}
    2827
  • osgVisual/src/extLink/manip_extLink.cpp

    r87 r88  
    2424extLinkManipulator::extLinkManipulator()
    2525{
    26         #include <leakDetection.h>
    2726}
    2827
  • osgVisual/src/manip_ObjectMounted/manip_objectMounted.cpp

    r87 r88  
    2525objectMountedManipulator::objectMountedManipulator()
    2626{
    27         #include <leakDetection.h>
    2827}
    2928
  • osgVisual/src/manip_Spacemouse/manip_freeSpaceMouse.cpp

    r87 r88  
    2525FreeManipulator::FreeManipulator(SpaceMouse* spacemouse) : _spaceMouse(spacemouse)
    2626{
    27         #include <leakDetection.h>
    2827}
    2928
  • osgVisual/src/manip_Spacemouse/manip_nodeTrackerSpaceMouse.cpp

    r87 r88  
    2525NodeTrackerSpaceMouse::NodeTrackerSpaceMouse(SpaceMouse* spacemouse) : _spaceMouse(spacemouse)
    2626{
    27         #include <leakDetection.h>
    2827    _trackerMode = NODE_CENTER_AND_ROTATION;
    2928    _rotationMode = TRACKBALL;
  • osgVisual/src/manip_Spacemouse/manip_spaceMouse.cpp

    r87 r88  
    168168SpaceMouse::SpaceMouse() : _spaceMouseImpl(new SpaceMouseImpl)
    169169{
    170         #include <leakDetection.h>
    171170}
    172171
  • osgVisual/src/object/object_updater.cpp

    r87 r88  
    2121object_updater::object_updater(osgVisual::visual_object* object_ )
    2222{
    23         #include <leakDetection.h>
    2423}
    2524
  • osgVisual/src/object/visual_object.cpp

    r87 r88  
    2121visual_object::visual_object( osg::CoordinateSystemNode* sceneRoot_, std::string nodeName_)
    2222{
    23         #include <leakDetection.h>
    24 
    2523        // Add this node to Scenegraph
    2624        sceneRoot_->addChild( this );
  • osgVisual/src/sky_Silverlining/skySilverLining_cloudsDrawable.cpp

    r87 r88  
    3333        : osg::Drawable()
    3434{
    35         #include <leakDetection.h>
    3635    setDataVariance(osg::Object::DYNAMIC);
    3736    setUseVertexBufferObjects(false);
  • osgVisual/src/sky_Silverlining/skySilverLining_skyDrawable.cpp

    r87 r88  
    3636                , _skyboxSize(0)
    3737{
    38         #include <leakDetection.h>
    39        
    4038    setDataVariance(osg::Object::DYNAMIC);
    4139    setUseVertexBufferObjects(false);
  • osgVisual/src/sky_Silverlining/visual_skySilverLining.cpp

    r87 r88  
    2222{
    2323        OSG_NOTIFY( osg::ALWAYS ) << "Initialize visual_skySilverlining..." << std::endl;
    24         #include <leakDetection.h>
    2524
    2625        atmosphereInitialized = false;
Note: See TracChangeset for help on using the changeset viewer.