Re: pfDelete problems

New Message Reply Date view Thread view Subject view Author view

Marcus Barnes (marcus++at++multigen.com)
Wed, 9 Apr 1997 17:36:49 -0700


On Apr 9, 4:16pm, Chris Mitchell wrote:
> Marcus Barnes wrote:
> > It will safely delete only pfMemory objects or objects derived from
> > pfMemory. It will stop following a chain as soon as it hits an object in
> > that chain whose reference count is greater than zero.
>
> So it seems you would have to write your own tree traversal to >really<
> delete subgraphs, since the recursive deletion behavior of pfDelete mentioned
> in the man pages will not work unless all nodes have refcount 0.

No not at all!

pfDelete will delete an entire graph of pfNode's given the root node. pfNode
handle their own reference counting and forward the delete request to their
children. pfNode's also delete their pfUserData if it is a pfMemory or derived
object (pfObject for example). pfNode's do _not_ delete their pfNodeTravData
however.

> Wouldn't it be nice if you had some function in performer that deleted
> everything in the scene graph below a node (like pfFree) but without
> causing the "mysterious memory corruption" threatened on pfFree's man page?

pfFree is not mysterious. It unconditionally and immediately frees memory. This
is generally a bad thing to do in Performer's multiprocessing environment. If
you have a choice, use pfDelete instead.

> Is there such a function?

Yes. It's called pfDelete.

Regards.

--
+ Marcus Barnes, Technical Staff        mailto:marcus++at++multigen.com +
+ Multigen Inc.                         http://www.multigen.com    +
+ 550 S. Winchester Blvd.               phoneto:1-408-556-2654     +
+ Suite 500 San Jose CA 95128           faxto:1-408-261-4102       +
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:02 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.