diff options
-rw-r--r-- | src/sound_openal.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sound_openal.cpp b/src/sound_openal.cpp index cc5261eae..0cfbc2798 100644 --- a/src/sound_openal.cpp +++ b/src/sound_openal.cpp @@ -271,6 +271,16 @@ public: m_context = NULL; alcCloseDevice(m_device); m_device = NULL; + + for (std::map<std::string, std::vector<SoundBuffer*> >::iterator i = m_buffers.begin(); + i != m_buffers.end(); i++) { + for (std::vector<SoundBuffer*>::iterator iter = (*i).second.begin(); + iter != (*i).second.end(); iter++) { + delete *iter; + } + (*i).second.clear(); + } + m_buffers.clear(); infostream<<"Audio: Deinitialized."<<std::endl; } |