From: sapier Date: Sun, 7 Apr 2013 19:17:26 +0000 (+0200) Subject: fix memory leak on sound shutdown X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=e7247c1a66e2a61d5b4a97d9cab02194b97de53b;p=zefram%2Fminetest%2Fminetest_engine.git fix memory leak on sound shutdown --- diff --git a/src/sound_openal.cpp b/src/sound_openal.cpp index cc5261ea..0cfbc279 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 >::iterator i = m_buffers.begin(); + i != m_buffers.end(); i++) { + for (std::vector::iterator iter = (*i).second.begin(); + iter != (*i).second.end(); iter++) { + delete *iter; + } + (*i).second.clear(); + } + m_buffers.clear(); infostream<<"Audio: Deinitialized."<