Pbuffer destroy

Hi all

How can one destroy a pbuffer? I’m using a pbuffer for offscreen rendering, and when resizing is needed, I must get rid of the old one and replace it with a new. However, the old one stays in the video memory, because the free memory decreases when I try to destroy the old one and create a new one. I tried to call


                pbuffer.getContext().destroy();
                pbuffer.removeGLEventListener(eventHandlingGLListener);
                pbuffer.destroy();

but with no result. Any ideas or hints? I’m using a mobility radeon 9000 and I cehc my free GPU memory using the ATI Tray Tools utility.

Basically, if you haven’t created any OpenGL contexts of your own on the pbuffer, just calling pbuffer.destroy() should be sufficient.

I’d suggest trying your application on another machine (my recommendation: NVidia hardware, latest drivers) and see whether the leak goes away. If it does, there’s a problem with your drivers. You might want to look for the most recent version available from ATI.

Also, keep in mind that if you’ve shared textures and display lists with another OpenGL context on another drawable that those texture objects are going to stay alive as long as any of the contexts in the “share set” are still alive. You’ll need to destroy all of them (meaning that at some point in time they all have to be destroyed) in order to reclaim that memory.