Hi Anish, I've just reviewed your changes but they don't seem address the problems. I'm not the author of the orignal code so like your are having to look at the code to see what it is meant to do. The fixes you have applied raise more questions as much about the original code as your changes.
To solve the problems in the DelaunayTriagnulator I believe we'll need to do some more work on characterising the problems you've seen and how the code is probably intended to function. Could provide the warings/errors you have seen on your system? Here are some of my thoughts. The DelaunayConstraint::~DelaunayConstraint() as it stands before you changes calls delete [] on all elements in the _interiorTris vector which looks correct to me. Calling delete on NULL pointer should be a safe and simply a non op so in theory your change should make no functional difference. osg::DrawElementsUInt *DelaunayConstraint::makeDrawable() method looks to be poorly named, it really should be something like makePrimitiveSet(). You change of return NULL if the _interiorTris is empty() is not unreasonable, but it'll only function correctly if calls to makeDrawable() check the return value other wise you could end up assigning a null pointer to a Geode. The really odd thing is the makeDrawable() is called from osg::Vec3Array* DelaunayConstraint::getPoints(const osg::Vec3Array *points) method but it doesn't do anything other than call the method, it doesn't do anythign with the returned PrimittiveSet instead it just leaks it. Is this the leak you were suggesting? Your change won't address this. The makeDrawable() method is really suspicious, it either is missing an assignment of the primitive set to a geometry or it's missing handling code in getPoints(). Thoughts? Robert. On 16 July 2013 08:52, Anish Thomas <[email protected]> wrote: > Hi, > > There is an assert (with debug binaries in STL bounds-checking code) that can > occur while using the Delaunay Triangulator, and there are also memory leaks. > > The fixes are attached. Tested on Windows and iPhone with OSG 3.1.7 > > Thank you! > > Cheers, > Anish > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=55227#55227 > > > > > Attachments: > http://forum.openscenegraph.org//files/delaunay_fix_206.zip > > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
