Destroy SoundController resources before exit.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2016-10-13 04:52:03 -04:00
parent 2d150c9939
commit 410e6d6765

View File

@ -19,6 +19,7 @@
package itdelatrisu.opsu;
import itdelatrisu.opsu.audio.MusicController;
import itdelatrisu.opsu.audio.SoundController;
import itdelatrisu.opsu.beatmap.Beatmap;
import itdelatrisu.opsu.beatmap.BeatmapSetList;
import itdelatrisu.opsu.beatmap.BeatmapWatchService;
@ -131,6 +132,9 @@ public class Container extends AppGameContainer {
// prevent loading tracks from re-initializing OpenAL
MusicController.reset();
// stop any playing track
SoundController.stopTrack();
// reset BeatmapSetList data
if (BeatmapSetList.get() != null)
BeatmapSetList.get().reset();
@ -144,8 +148,7 @@ public class Container extends AppGameContainer {
BeatmapWatchService.removeListeners();
// delete temporary directory
if (Options.TEMP_DIR.isDirectory())
Utils.deleteDirectory(Options.TEMP_DIR);
Utils.deleteDirectory(Options.TEMP_DIR);
}
@Override