Login  Register

Re: Should I call glDeleteBuffers to destroy VBOs?

Posted by gouessej on Feb 24, 2012; 9:23pm
URL: https://forum.jogamp.org/Should-I-call-glDeleteBuffers-to-destroy-VBOs-tp3771162p3773793.html

If you always remove the reference of the buffer from your cache when calling glUnmapBuffer & glDeleteBuffers, there won't be any problem, otherwise the cleaner might be called several times (once by me, once again later when your cache is eventually cleared) even on different threads. In my case, I will always call all cleaners on the thread used to perform the rendering.

Riven reminded me that the use of these cleaners is possible only in signed applications, I was almost sure of that.

Edit.: Do you agree with that statement?
http://www.java-gaming.org/topics/a-general-approach-for-nio-buffer-pooling/25537/msg/224092/view.html#msg224092
"Yes, it can crash the entire process. This is why libraries like JOGL and LWJGL keep a reference to the buffer you passed to those methods. Before that was done, the GC could free that memory, resulting in an access violation in the driver."
Julien Gouesse | Personal blog | Website