Re: Change scene
Mario Veraart (rioj7++at++fel.tno.nl)
Mon, 31 Aug 1998 14:43:26 +0200 (MET DST)
Scott Herod wrote:
>
> Mario Veraart wrote:
>
> > > Is there a simple methord to free
> > > all
> > > the resources taken by a scene node?
> >
> > Just call pfDelete() on the node that you want to delete and
> > everything below it is deleted as well. Be aware that it will take a
> > few frames until the resources are really free, this is because the
> > cull and draw might be needing this stuff.
>
> Is that really true? I don't think that removing a DCS for
> example correctly deletes things like GeoStates attached to a
> GeoSet under the DCS. As an example, attach something like the
> following to the bottom of the simple.C code. I can send you
> the entire source if necessary.
>
> Scott Herod
> herod++at++evt.com
> sherod++at++colorado.edu
>
> // ========== Delete Test ==================
>
> printf("GeoState ref count = %d.\n", geostate->getRef());
> printf("Delete DCS attempt = %d.\n", pfDelete(dcs));
>
> scene->removeChild(dcs);
>
> printf("Delete DCS attempt = %d.\n", pfDelete(dcs));
> printf("GeoState ref count = %d.\n", geostate->getRef());
>
> printf("Delete GeoState attempt = %d.\n", pfDelete(geostate));
>
> // ========== Delete Test ==================
>
> pfExit();
> return 0;
>
I think the reason why it is not deleted is that performer pospones
the deletion a few frames to be sure that nobody accesses this node.
Try this inside the mainloop or add a few pfFrame() calls after
the pfDelete (haven't tried it myself).
Mario
This archive was generated by hypermail 2.0b2
on Mon Aug 31 1998 - 05:44:57 PDT