Archived

This topic is now archived and is closed to further replies.

Gary

DeleteTextureByIndex

Recommended Posts

Gary    122
Ok, I create a texture using: TextureNumber = PR_AddTexture (TextureMaterialName, TextureSurface); Now... If I call: if(TextureNumber != -1) PR_DeleteTextureByIndex (TextureNumber); The PR Log reports a memory leak. However, if I comment out this line, and let the PR_DeleteAllTextures free it, it no longer gives me a memory leak in the log file. Using the debugger I watched the memory for the texture and it does look like it is being freed. Maybe the memory manager just isn''t catching it? or what is going on here... Gary

Share this post


Link to post
Share on other sites
ChrisE    184
You still need to call PR_DeleteAllTextures before the program ends, because it frees the pointer to the texture list itself, in addition to all the textures stored within.




Author of Power Render (http:/www.powerrender.com)

Share this post


Link to post
Share on other sites
Gary    122
I am...


If I call:
if(TextureNumber != -1) PR_DeleteTextureByIndex (TextureNumber);
PR_DeleteAllTextures();

It reports a memory leak;

If I call:
PR_DeleteAllTextures();


It doesnt....



Gary

Share this post


Link to post
Share on other sites