diff --git a/SDL2pp/Chunk.hh b/SDL2pp/Chunk.hh index 4029c55..b706b5a 100644 --- a/SDL2pp/Chunk.hh +++ b/SDL2pp/Chunk.hh @@ -80,6 +80,13 @@ public: /// /// \see https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC24 /// + /// \note Despite what Mix_FreeChunk() documentation (and even + /// comment in function implementation) says, right after + /// the named comment there's a code which stops playback + /// of any channel which plays the chunk being freed. + /// Thus, it is safe to destroy Chunk before destroying + /// Mixer, even if it still plays the chunk. + /// //////////////////////////////////////////////////////////// ~Chunk(); diff --git a/examples/mixer.cc b/examples/mixer.cc index 8a36492..59e61b8 100644 --- a/examples/mixer.cc +++ b/examples/mixer.cc @@ -73,9 +73,6 @@ int main() try { SDL_Delay(2000); - // Make sure no sounds are being played before destroying Chunk - mixer.HaltChannel(); - return 0; } catch (std::exception& e) { std::cerr << "Error: " << e.what() << std::endl;