diff --git a/libs/B-luga-graphics/src/RaylibImpl/Audio/Audio.cpp b/libs/B-luga-graphics/src/RaylibImpl/Audio/Audio.cpp index b35cb47..bba30d7 100644 --- a/libs/B-luga-graphics/src/RaylibImpl/Audio/Audio.cpp +++ b/libs/B-luga-graphics/src/RaylibImpl/Audio/Audio.cpp @@ -173,4 +173,18 @@ namespace Raylib { { return _path; } + + ~SoundImpl::SoundImpl() + { + if (isReady()) { + unload(); + } + } + + ~MusicImpl::MusicImpl() + { + if (isReady()) { + unload(); + } + } } // namespace Raylib diff --git a/libs/B-luga-graphics/src/RaylibImpl/Audio/Audio.hpp b/libs/B-luga-graphics/src/RaylibImpl/Audio/Audio.hpp index dc3daac..cc906b6 100644 --- a/libs/B-luga-graphics/src/RaylibImpl/Audio/Audio.hpp +++ b/libs/B-luga-graphics/src/RaylibImpl/Audio/Audio.hpp @@ -20,6 +20,8 @@ namespace Raylib { public: SoundImpl(const std::string& fileName, float volume); + ~SoundImpl(); + bool isReady() const override; void unload() override; @@ -56,6 +58,8 @@ namespace Raylib { public: MusicImpl(const std::string& fileName, float volume); + ~MusicImpl(); + void unload() override; bool isReady() const override;