Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix memory leak on sound shutdown
- Loading branch information
Showing
with
10 additions
and
0 deletions.
-
+10
−0
src/sound_openal.cpp
|
@@ -271,6 +271,16 @@ class OpenALSoundManager: public ISoundManager |
|
|
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; |
|
|
} |
|
|
|
|
|