It's a good idea to halt playback before Chunk destruction

This commit is contained in:
Dmitry Marakasov 2015-08-28 23:26:51 +03:00
parent c5dc35574d
commit 30734317c8
2 changed files with 4 additions and 1 deletions

View File

@ -271,7 +271,7 @@ public:
/// \see https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC34 /// \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 /// \brief Change the timed stoppage of a channel

View File

@ -55,6 +55,9 @@ int main() try {
SDL_Delay(4500); SDL_Delay(4500);
// Make sure no chunks are being played before destroying Chunk
mixer.HaltChannel();
return 0; return 0;
} catch (std::exception& e) { } catch (std::exception& e) {
std::cerr << "Error: " << e.what() << std::endl; std::cerr << "Error: " << e.what() << std::endl;