StandardGame does not shutdown completely when using Java Webstart

Hi!



When using Java Webstart, we have to call System.exit(0); it is necessary. But it is not called in StandardGame. What about adding such a call in the method quit()?


   protected void quit() {
        if (display != null) {
            display.reset();
            display.close();
        }
        System.exit(0);
    }

I thought StandardGame's opengl thread is set up as daemon thread, but it seems it isn't.

I'm not sure if System.exit() is a good idea, as it kills the vm but maybe other threads need to do some cleanup also ?



There where a few threads about that problem already.



http://www.jmonkeyengine.com/jmeforum/index.php?topic=11011.0



does a simple gameThread.setDaemon(true); (StandardGame.java:Line 188)  help in your case?

Core-Dump said:

I thought StandardGame's opengl thread is set up as daemon thread, but it seems it isn't.
I'm not sure if System.exit() is a good idea, as it kills the vm but maybe other threads need to do some cleanup also ?

There where a few threads about that problem already.

http://www.jmonkeyengine.com/jmeforum/index.php?topic=11011.0

does a simple gameThread.setDaemon(true); (StandardGame.java:Line 188)  help in your case?

I gave a look at the documentation, it might be a more elegant way of solving this problem, I'm going to test it. If it works, can you submit this change please?

sure, if it works and has no side effects

Core-Dump said:

sure, if it works and has no side effects

It does not work :(

How do you exit your game. do you just call StandardGame.finish()?

Do you spawn any other threads in your game?

Core-Dump said:

How do you exit your game. do you just call StandardGame.finish()?
Do you spawn any other threads in your game?

I call the method shutdown() that calls the method finish(). I don't create other threads in my game. It quits correctly when executed locally but still not with Java Webstart except sometimes.