diff --git a/Capy64/Runtime/Libraries/Audio.cs b/Capy64/Runtime/Libraries/Audio.cs index 23bed03..5180126 100644 --- a/Capy64/Runtime/Libraries/Audio.cs +++ b/Capy64/Runtime/Libraries/Audio.cs @@ -14,6 +14,7 @@ public class Audio : IPlugin public Audio(IGame game) { _game = game; + _game.EventEmitter.OnClose += OnClose; } private static LuaRegister[] AudioLib = new LuaRegister[] @@ -214,4 +215,9 @@ public class Audio : IPlugin return 1; } + + private void OnClose(object sender, EventArgs e) + { + _game.Audio.Sound.Stop(true); + } }