projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0d26bb3
)
fix memory leak on sound shutdown
author
sapier
<Sapier at GMX dot net>
Sun, 7 Apr 2013 19:17:26 +0000
(21:17 +0200)
committer
kwolekr
<kwolekr@minetest.net>
Mon, 8 Apr 2013 03:43:34 +0000
(23:43 -0400)
src/sound_openal.cpp
patch
|
blob
|
history
diff --git
a/src/sound_openal.cpp
b/src/sound_openal.cpp
index cc5261eaeb82619ee2eb4ab3051466ab1c3500d5..0cfbc279829a95978c94979d3339eb4be67332d8 100644
(file)
--- 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;
}