What do you mean, does not stop?
The openGL window closes but the application is still running?
I ported a testgame of mine using nifty to 3.1 alpha. I can check my behaviour in a few hours.
Okay, so my quit button in my JME 3.1 test project basically just executes
g_simpleApplication.stop();
if I exit the nifty first, I actually get a nullpointer in the inputmanager before reaching application.stop().
Why do you explicitly exit nifty first?
If I explicitly exit the nifty before calling application.stop() in my larger jme 3.0 project, I get a nullpointer during during Screen.endScreen. We simply call application.stop() there as well.
Iâve got no nullpointer, but with 3.0 the project closed without problems and in 3.1 only the frame itself is closing but the thread is still running.
Is your jme context in a window?
Our mapeditor (swing based, ewww) had a swing thread that we had to terminate by hand.
As mentioned my projects behave differently and I cannot see the difference without further details.
If you could build a minimal example and upload it to github or so, then I would love to have a look at it.
We are using the default SimpleApplication and default jme thread to launch our project. I could upload you a snippet but wouldnât make sense unless you get a full picture of each component we are using. Maybe there have been a big change to the sound manager of jme which has to be terminated differently (or something else).
Oh yeah, what OS are you running?
I am on Ubuntu Linux 14.04. If youâre on windows the awt thread can behave differently.
I remember the open dialogs bahave completely different between win/mac/linux.
(Not just the window itself, but when it opens and if the other window is disabled or not)
Hmm I donât have a magical answer for you, sorry.
I would try it on different OS to see if itâs windows specific, or even windows 10 specific.
Donât know what they changed for Win 10. Havenât installed it yet.
As I said I would create a minimal example with all the JME components (Sound, etc) you have in place,
and then see if it closes.
If it does, you know that your problem lies elsewhere.
Are you sure itâs thread-4 thatâs hold the app open? In the source code you reference, that thread is clearly marked as a daemon thread. It shouldnât be keeping the JVM from exiting.
Are you actually enabling the tracking?
Cause by default it is disabled, so if no explicit call to BufferUtils.setTrackDirectMemotyEnabled(true) is done, it should not even start that thread.
Also this is older than 3.1 it is from 2012, so it would have probably caused issues for others as well. (or noone does use the tracking)
âTimer-0â isnât a daemon, it might be causing problems. It looks like a standard java.util.timer thread. Do you start that? Can you cancel()/stop()/interrupt() it to get it to stop running?
If youâre the one starting that timer, thereâs specific ctors to use to start the internal thread as a daemon. I assume theyâre there specifically for this problem.
Timer()
Creates a new timer.
Timer(boolean isDaemon)
Creates a new timer whose associated thread may be specified to run as a daemon.
Timer(String name)
Creates a new timer whose associated thread has the specified name.
Timer(String name, boolean isDaemon)
Creates a new timer whose associated thread has the specified name, and may be specified to run as a daemon.