diff --git a/SDL2pp/Mixer.hh b/SDL2pp/Mixer.hh index af326cd..23c4685 100644 --- a/SDL2pp/Mixer.hh +++ b/SDL2pp/Mixer.hh @@ -271,7 +271,7 @@ public: /// \see https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC34 /// //////////////////////////////////////////////////////////// - void HaltChannel(int channel); + void HaltChannel(int channel = -1); //////////////////////////////////////////////////////////// /// \brief Change the timed stoppage of a channel diff --git a/examples/mixer.cc b/examples/mixer.cc index c903adf..38cc8df 100644 --- a/examples/mixer.cc +++ b/examples/mixer.cc @@ -55,6 +55,9 @@ int main() try { SDL_Delay(4500); + // Make sure no chunks are being played before destroying Chunk + mixer.HaltChannel(); + return 0; } catch (std::exception& e) { std::cerr << "Error: " << e.what() << std::endl;