Hi all, maybe I'm missing something here but I can't find where (or better when) I'm supposed to deallocate OpenGL resources using glDelete*() calls, to free memory used by textures, vbo geometry, etc in order to prevent memory leaks.
I've tried within stop() -- that looks like some kind of PApplet equivalent of the c++ destructor -- but using the following code within stop():
Code:
pgl = (PGraphicsOpenGL) g; // g may change
gl = pgl.beginGL(); // always use the GL object returned by pgl
generates an error log in the applet folder after the applet is run and closed within firefox.
(Internet explorer is more annoying and creates the error log right on the desktop!)
Anyways, the gl object returned by beginGL() is != null, but somehow invalid.
Code:
# An unexpected error has been detected by Java Runtime Environment:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000, pid=2344, tid=3468
[...]
Stack: [0x03060000,0x030b0000], sp=0x030af914, free space=318k
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.sun.opengl.impl.GLImpl.glPushMatrix()V+0
j processing.opengl.PGraphicsOpenGL.beginGL()Ljavax/media/opengl/GL;+4
j threesixty3d.stop()V+16
j com.sun.opengl.util.JOGLAppletLauncher.stop()V+11
j sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run()V+1398
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
Any ideas? Is there another place that can be used as a GPU resource destructor? or does JOGL take care of deallocating GPU resources automagically? Thanks!
Michele