Steve Baker (steve++at++mred.bgm.link.com)
Tue, 28 Jan 97 11:20:09 -0500
> I have been trying to write a function that would free memory for a
> Performer subgraph given the root node of the subgraph to be deleted.
...lots of code...
Why all the complication?
Just pfRemoveChild the root node from the tree and then pfDelete it and you are done.
RTFM for pfDelete:
pfDelete frees the memory associated with mem if its reference count is
<= 0. When an object is freed, it decrements the reference count of all
pfMemories that it once referenced and will delete any of these
pfMemories with reference counts that are <= 0. Thus, pfDelete will fol-
low all reference chains until it encounters a pfMemory which it cannot
delete. Note that the reference count of a pfNode is incremented each
time it is added as a child to a pfGroup. Thus, a pfNode must be removed
from all its parents before it can be deleted.
This means that it will recursively do just what you want.
If you are deleting in realtime, you might want to consider pfAsyncDelete().
Steve Baker 817-619-1361 (Vox-Lab)
Hughes Training Inc. 817-619-8776 (Vox-Office/Vox-Mail)
2200 Arlington Downs Road 817-619-4028 (Fax)
Arlington, Texas. TX 76005-6171 Steve++at++MrEd.bgm.link.com (eMail)
http://www.hti.com (external) http://MrEd.bgm.link.com/staff/steve (intranet)
http://web2.airmail.net/sjbaker1 (external)
"You can't destroy the Earth - that's where I keep all my stuff!" - The Tick.
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:29 PDT