Selon Melchior FRANZ:
> > it was copied in the _removedChild vector before
> > returning, hence incrementing the counter. If you don't care having
> > aliases pointing to garbage ( something David was against ), you would
> > just have to dump the _removedChild vector and, if the
> > SGPropertyNode_ptr returned is not used, the tree should be destroyed.
> > Two functions shouldn't be necessary.
> It would have to do this recursively. Because neither SGPropertyNode_ptr
> nor SGPropertryNode do AFAIK destroy their children on destruction.
> don't know if this would be desirable.)
For a reason : it is the job of SGPropertyNode_ptr destructor :
if (_ptr && _ptr->decrementRef() == 0)
If the vector of children SGPropertyNode_ptr is properly cleared in the
SGPropertyNode destructor, the whole tree should go away recursively.
Flightgear-devel mailing list