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