Re: [osg-users] memory leak in osg 2.8.2 ?
Hi Chris, thx for your answer and your trick ! :) but it is the same for me... struct TheEnd { ~TheEnd() { _CrtDumpMemoryLeaks(); } }; TheEnd theEnd; int _tmain(int argc, _TCHAR* argv[]) { osg::ref_ptr osg::Group gr; return 0; } Detected memory leaks! Dumping objects - {792} normal block at 0x00B17320, 128 bytes long. Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 {791} normal block at 0x00B172D8, 12 bytes long. Data: r r D8 72 B1 00 D8 72 B1 00 CD CD CD CD stange ? Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18379#18379 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] memory leak in osg 2.8.2 ?
Hi Sebastien, Hmmm, just looking my code again and realized I didn't actually perform the check directly. I delay the leak check until nearer termination using _CrtSetDbgFlag. e.g.: Code: ~TheEnd() { _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF); } Seems to work ok for me in VS2005. Cheers, Chris -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18380#18380 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] memory leak in osg 2.8.2 ?
Hi Bryan, ok thx for your answer (even if I do not understand the 1st part of your message?) I did some research on the forum before posting, but maybe it wasn't enought. Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18319#18319 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] memory leak in osg 2.8.2 ?
The trick, if I can call it that, is to perform the leak check in the destructor of the last destroyed object. Works for me! You just need to make sure your global heap check object is created before OSG gets to make its evil singletons ;-) . e.g. Code: struct TheEnd { ~TheEnd() { CheckForLeaks(); } }; TheEnd theEnd; int main(int argc, char* argv[]) { osgViewer::Viewer viewer; viewer.run(); return 0; } Cheers, Chris -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18328#18328 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org