From: Angus Dorbie (dorbie++at++sgi.com)
Date: 02/08/2000 13:00:30
Joaquín Casillas Meléndez wrote:
>
> Hello.
>
> I'm trying to delete some nodes in my pfapp at run time in order to free
> memory. I have tried pfDelete, pfUnrefDelete, pfFree, ..., without
> succesful. Memory don't seem to be freed at all. I have checked the ref
> value of the nodes and seems to be right in some cases, but in other the
> ref count of the node is greater than one and I force it to be zero
> (pfDelete always returns TRUE).
Forcing to zero will leave a 'dangling pointer', and may cause memory
corruption of subsequently allocated data when the pointer is ultimately
referenced. If ref count isn't zero then you should figure out where it
is being used. You should only unrefdelete if you have incremented the
ref count for your own purposes. Just pfDelete will work unless you have
used a performer function to reference the memory, which would
automatically increment the ref count.
Just how do you know memory isn't being freed?
>
> The idea is to load/unload models in response to some event. I know the
> right way to achieve this is by using the pfDBase method, but I think
> this mechanism is not supported in the current Performer-Linux
> environment due to pfBuffers (perhaps I'm wrong at this point; please,
> confirm this).
Currently you are single threaded on Linux and so this is a non issue,
just create and delete objects as normal and it should just work without
reference to other buffers. I think buffers should still work.
Cheers,Angus.
-- For Performer+OpenGL tutorials http://www.dorbie.com/ My comment on the abuse of Jon Johanson's rights; After giving up raiding their neighboring countries the Norse men have taken to raiding 16 year old kids in their bedrooms. Very sad.
This archive was generated by hypermail 2b29 : Tue Feb 08 2000 - 13:00:42 PST