Login  Register

Re: Shutting down Java3D

Posted by philjord on May 01, 2020; 5:14am
URL: https://forum.jogamp.org/Shutting-down-Java3D-tp4040572p4040573.html


During a regular life cycle the Java3D system is cleanly tidied up at the end of it's life by the AWT system calling the
Canvas3D.removeNotify();

This is an overridden method of Canvas which shuts down the 3d renderer system nicely.

removeNotify() is a blocking call so if you are shutting down in a hard manner where the length of time you have to clean up may be short and you need a non-blocking call that will tidy up somewhat, then you can call
Canvas3D.stopRenderer();

which will tell the 3d Renderer thread to shut down but won't block the calling thread.

Note there is also
SimpleUniverse.cleanup();
Which will release some memory, but is not useful during a forced shutdown.

I hope this helps.
Phil.