Did the code help ?

/adrian

2009/1/30 Adrian Egli OpenSceneGraph (3D) <3dh...@gmail.com>

> Hi Robert, Cory,
>
> I implement some weeks before a memory leak detector for VS 2005 and
> cleaned up the code that all of my objects get right removed from memory
> now, espacially i had some bad behaviour before
> cleaning up my webbased rendering plugin, after removing all memory leak
> even quicktime get closed without any crashes. so it's really important that
> all allocated memory gets
> fine removed. the plugin don't have some leaks coming through the OSG core,
> and believe me: our application is much more complex than just use some
> geometry nodes.
> and i can say that the osg core should be free of any memory leak, i
> suggest using in all user application the ref_ptr concept which robert is
> using in the core of osglib then you don't get some leaks.
> I also believe that there is also many false positives...
>
> Here is the code you should use :
> // memory leak check ...
>
>
> -----------------------------------------------------------------------------------------------------------------------------------------------
> MEM_LEAK_BASE.h
>
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>
> -----------------------------------------------------------------------------------------------------------------------------------------------
> Just include this in each CPP file
>
>
> #ifdef MEM_LEAK_CHK
> #include "DbgMemoryImpl.h"
> #endif
>
>
>
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>
> i hope this works also ................
>
> /adrian
>
>
> 2009/1/30 Robert Osfield <robert.osfi...@gmail.com>
>
> Hi Cory,
>>
>> I believe the are bugs in the memory tracking support in VS,
>> especially when using MFC, that produce many false positives.  You'll
>> need to get more info about this from VS experts though, the last time
>> I used VS was in the last Century!
>>
>> Robert.
>>
>> On Fri, Jan 30, 2009 at 3:32 PM, Cory Riddell <c...@codeware.com> wrote:
>> > After my (MFC) app ends, the output window in Visual Studio fills with a
>> > bunch of this:
>> >>
>> >> Detected memory leaks!
>> >> Dumping objects ->{164} normal block at 0x02A54248, 128 bytes long.
>> >>  Data: <                > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> 00
>> >> {163} normal block at 0x02A541A8, 96 bytes long.
>> >>  Data: <  c             > F8 87 63 01 00 00 00 00 01 00 00 00 00 00 00
>> 00
>> >> {161} normal block at 0x02A54068, 64 bytes long.
>> >>  Data: <OpenThread v1.2p> 4F 70 65 6E 54 68 72 65 61 64 20 76 31 2E 32
>> 70
>> >
>> > I'm just getting started with OSG. I'm using it to render geometry from
>> > Granite (the geometry kernel from the Pro/ENGINEER people, just getting
>> > started with this too). Both libraries have their own reference counted
>> > pointer types and they function a bit differently so I'm probably just
>> > abusing one or the other.
>> >
>> > Normally I can just pick one of the allocation numbers from the dump
>> (161,
>> > 163, and 164 above) and tell the debugger to stop there, but for some
>> reason
>> > that isn't working. If I have time later today, I'm going to instrument
>> > everything with BoundsChecker and run it again.
>> >
>> > Cory
>> >
>> >
>> > On Fri, Jan 30, 2009 at 9:08 AM, Robert Osfield <
>> robert.osfi...@gmail.com>
>> > wrote:
>> >>
>> >> Hi Cory,
>> >>
>> >> The OSG users ref counting, so if all external references to the scene
>> >> and viewer are removed then all the associated resources should be
>> >> deleted automatically.  If you app keeps any references to this data
>> >> then it'll stay around until these references are removed.
>> >>
>> >> If you've enabled caching in the osgDB::Registry then it can keep
>> >> around a reference for loaded objects in its cache, so clearing this
>> >> would be required.   Also if you app loads OSG plugins as part of
>> >> loading your data then one could see this as items you might want to
>> >> unload.
>> >>
>> >> BTW, what makes you think that things aren't being released?
>> >>
>> >> Robert.
>> >>
>> >> On Fri, Jan 30, 2009 at 2:57 PM, Cory Riddell <c...@codeware.com>
>> wrote:
>> >> > Is there a correct way to stop OSG and free all the resources that
>> have
>> >> > been
>> >> > acquired by without stopping the application? I thought that when my
>> >> > osgViewer::Viewer instance went out of scope, everything would be
>> >> > released,
>> >> > but that doesn't seem to be the case.
>> >> >
>> >> > cory
>> >> >
>> >> > _______________________________________________
>> >> > osg-users mailing list
>> >> > osg-users@lists.openscenegraph.org
>> >> >
>> >> >
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >> >
>> >> >
>> >> _______________________________________________
>> >> osg-users mailing list
>> >> osg-users@lists.openscenegraph.org
>> >>
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >
>> >
>> > _______________________________________________
>> > osg-users mailing list
>> > osg-users@lists.openscenegraph.org
>> >
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >
>> >
>> _______________________________________________
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
> --
> ********************************************
> Adrian Egli
>



-- 
********************************************
Adrian Egli
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to