Search code examples
javaopengllwjgl

Java absolute cleanup


I have noticed that many people call methods to remove opengl data like VBOs from memory before closing the application (not only in lwjgl or java).

But shouldn't all data be removed, when the application loop ends? If not, then what would be the best way to absolutely clean memory after closing java application(including opengl and lwjgl data)?


Solution

  • OpenGL objects will be deleted by the destruction of the OpenGL context (which in LWJGL, I suppose happens when the OpenGL window is destroyed). So you don't have to delete them yourself. But good coding practice says that you should.