How to cleanup on java finalization?

Hi,

on Windows machines the JVM calls destroy() when an applet gets closed (Browser or Tab). The other threads seem to finish their current run as well. That way its possible to set the Renderer-Class to “shutdown” and wait for the FPSAnimator to call the display-method. Within the display-method the gl-context is present and its save to delete the gl-objects (textures, lists, shader,…).
On Mac OS X and Linux the FPSAnimator never calls the display-method once the applet gets closed. And the display-method even does not run when triggered by hand. I see no way to wait for the user to “shutdown” the engine, it has to be triggered by hand (by clicking a button).

Is their another way to run the gl finialization on mac and linux?

Greetings,
Achilleos.

I haven’t tested it, but you could try to make the context current on destroy and call the appropriate shutdown methods yourself.

See makeCurrent in http://download.java.net/media/jogl/builds/nightly/javadoc_public/javax/media/opengl/GLContext.html

I tried that before: it does not work. The the context cannot be made current…