[commited] SimpleGame / SimpleApplet does not clean up AudioSystem

Using AudioSystem in SimpleGame causes a crash when exiting.

See jmetest.audio.TestMusicQueue for example.

Calling AudioSystem.cleanup() fixes that problem for me.



Index: src/com/jme/app/BaseSimpleGame.java
===================================================================
--- src/com/jme/app/BaseSimpleGame.java   (revision 4389)
+++ src/com/jme/app/BaseSimpleGame.java   (working copy)
@@ -68,6 +68,7 @@
 import com.jme.util.stat.graph.GraphFactory;
 import com.jme.util.stat.graph.LineGrapher;
 import com.jme.util.stat.graph.TabledLabelGrapher;
+import com.jmex.audio.AudioSystem;
 
 /**
  * A game implementation that handles numerous common tasks.
@@ -601,6 +602,9 @@
         KeyInput.destroyIfInitalized();
         MouseInput.destroyIfInitalized();
         JoystickInput.destroyIfInitalized();
+        if (AudioSystem.isCreated()) {
+            AudioSystem.getSystem().cleanup();
+        }
     }
 
     /**





Index: src/com/jmex/awt/applet/BaseSimpleApplet.java
===================================================================
--- src/com/jmex/awt/applet/BaseSimpleApplet.java   (revision 4389)
+++ src/com/jmex/awt/applet/BaseSimpleApplet.java   (working copy)
@@ -37,6 +37,7 @@
 import com.jme.util.stat.graph.GraphFactory;
 import com.jme.util.stat.graph.LineGrapher;
 import com.jme.util.stat.graph.TabledLabelGrapher;
+import com.jmex.audio.AudioSystem;
 
 /**
  * see {@link BaseSimpleGame}
@@ -507,6 +508,9 @@
       KeyInput.destroyIfInitalized();
       MouseInput.destroyIfInitalized();
       JoystickInput.destroyIfInitalized();
+      if (AudioSystem.isCreated()) {
+         AudioSystem.getSystem().cleanup();
+      }
    }
 
    /**