Hi Mikhail,

I have just reviewed your submission and am a little concerned that the line:

            _children.erase(citr++);

Could possible invalidate the citr iterator before it's incremented.
Whether it does or not will depend upon the order of operations chosen
by the compiler and it's optimization.

Replacing this line with:

            ChildList::iterator ditr= citr++;
            _children.erase(ditr);

Will achieve the same intended result but should should avoid the
possibility that compiler optimization causing problems.  With this
change the submission is checked into svn/trunk and OSG-3.2 branch.

BTW, did you do any profiling to look at the benefits of this change?
I suspect it'll be highly platform specific, something we've seen in
the past that I'll optimize code under Linux and see little cost with
heap allocations and then users under Windows will see a cost for
something that is negligible under Linux.

Cheers,
Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to