[osg-users] ref_ptr wrong utilisation ?

Vincent Bourdier vincent.bourdier at gmail.com
Fri Sep 19 07:35:08 PDT 2008


Hi,

Looking for memory leaks, Visual Leak Detector return me that :

---------- Block 0 at 0x01F12C18: 100 bytes ----------
  Call Stack:
    z:\projets\easymonitoring\3dem\trunk\include\terrain\textureinit.h (39):
TextureInit::TextureInit
    z:\projets\easymonitoring\3dem\trunk\src\terrain\terrain.cpp (21):
`dynamic initializer for 'textureInit''
    f:\sp\vctools\crt_bld\self_x86\crt\src\crt0dat.c (855): _initterm
    f:\sp\vctools\crt_bld\self_x86\crt\src\crtexe.c (512): __tmainCRTStartup
    f:\sp\vctools\crt_bld\self_x86\crt\src\crtexe.c (414): mainCRTStartup
    0x7C816FD7 (File and line number not available):
RegisterWaitForInputIdle
  Data:
[...]

with the following code :

class TextureInit  {

 public:

     TextureInit( unsigned int numCol, unsigned int numRow )
    {
[...]

                _texCoord = new osg::Vec2Array( numCol * numRow ); //l 39.
[...]
    }

~TextureInit()
     {
        _texCoord = NULL;
     }

//get method returning ref_prt
[...]

protected:

    osg::ref_ptr<osg::Vec2Array>            _texCoord;
}


TextureInit  is declarer as a global delcaration... maybe this can be the
only problem..

Any idea ?

Thanks,
Regards,

Vincent.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080919/8396870f/attachment-0002.htm>


More information about the osg-users mailing list