Re: How to correctly clean up Java3D?
Posted by Flo on Dec 09, 2014; 2:32pm
URL: https://forum.jogamp.org/How-to-correctly-clean-up-Java3D-tp4033725p4033731.html
I don't have a problem upgrading to 1.6, will just have to chose the correct .jars, because putting 50MB .jar files into our build will not be a famous decision ;-) But that's a minor problem and for any upgrade it will have to work first.
So, what is the expected behavior? Quite simple:
Before doing anything with J3D the VM is in state X (Threads, memory, etc.). Then I want to start J3D, use it, print, etc.etc. and then I want to go back to state X. No J3D or AWT Threads should be left, everything should be as if I never called J3D (except for the file I created, of course), so that I can start it again from scratch (in the same process) without any problems.
Simply put, I want to completely remove any traces of using J3D, cleaning up my VM.
I am testing the whole thing locally by simply starting a small application and testing, if I can call the J3D code twice, after which the application should close itself, since the main thread is done. Unfortunately, both things don't work.
And yes, I tried to call the protected finish() Method there, using reflection (I really like reflection, but that's almost as bad as the setFinalMember(...) method a colleague had to write a long time ago ;-) ), but while the method is executed without an error, it doesn't change anything. The application still doesn't close.
Another minor question: Whenever I start the OffScreenTest from the old J3D examples (with J3D 1.6, of course), with JFrame.setVisible(true) removed, some Java windows pop up for a moment, immediately closing again. Is this expected? I would prefer J3D not opening any windows at all for my purposes (as I need to render a 3D image to a file, but not on the screen).