On Apr 16, 2012, at 10:56 AM, Tom Browder wrote: > On Mon, Apr 16, 2012 at 07:52, Christopher Sean Morrison <[email protected]> > wrote: >> >> On Apr 16, 2012, at 7:24 AM, Tom Browder wrote: > ... >>> 2. Shouldn't a test for the "free flag" be built into the >>> db_free_tree function to return silently if the tree is already freed? >> >> That's a possible solution but doesn't sound like the right one. >> If a tree pointer was freed, it shouldn' t be referenced any longer. That's >> the problem. > > [1] Does that mean the tree pointer itself should have been set to > zero after the free?
Possibly, but usually the "dead" tree nodes are removed. Some NMG code, however, defers removals until after an entire list has been processed (for obvious performance reasons). I haven't looked at that specific code in question, but setting a pointer to NULL is more likely to cause a NULL dereference crash than setting magic to invalid (so that a bomb kicks instead of a crash) so it wouldn't be my first inclination. Cheers! Sean ------------------------------------------------------------------------------ For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 _______________________________________________ BRL-CAD Developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/brlcad-devel
