Substance LAF - Exiting

I've noticed that Substance has a problem with shutting down all it's threads when a StandardGame/State based application exits.



The LAF-Widget Fade Tracker keeps running.



To fix this, place the following into a State instance cleanup() method:



TrackableThread.requestStopAllThreads();



I haven't looked into the details of why this happens. However, it is noted in the 3.0 release notes (search for requestStopAllThreads).

Oh, yeah... you still have to figure out how you'd get the cleanup() method called...  :evil:

I've noticed this problem as well.  It doesn't happen in a BaseGame, but only in StandardGame?

Haven't tried it in BaseGame… why use BaseGame when you got StandardGame :D?



But it wouldn't take long to find out.

I think it's a global problem in jME with the latest version of Substance, it was just the way you said it that made me think you were referring explicitly to StandardGame.  I went back to an older version because of it.



I'll give requestStopAllThreads() a shot and then upgrade back.

guurk said:

Haven't tried it in BaseGame... why use BaseGame when you got StandardGame :D?



no offense but i do think standardgame has some problems need to be fixed.

i had a really hard time with chasecamera flickering when i was using standardgame+gamestates. and in the end i had to give it up and switch back to basegame+gamestates.
and it works just fine with basegame implementation.

guurk wasn't trying to say that StandardGame is perfect, but rather it is a better philosophical (in his and my opinion) approach to game development.



Realize that being so much newer conceptually and featureful as it is, there are bound to be more bugs.  In addition, the current features of jME were built and tested with BaseGame but most not with StandardGame so they were not necessarily designed with thread-safety in mind.



I definitely agree there are some issues in StandardGame that still need to be resolved though, and hopefully we can get them figured out. :slight_smile:

We will, esp as more people use it.

Argh, I just tried to drop this into my application and it's not working.  Substance 4 is still hanging on.