mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 08:03:45 +01:00
fix memory leak on sound shutdown
This commit is contained in:
parent
0d26bb36af
commit
e7247c1a66
@ -271,6 +271,16 @@ public:
|
|||||||
m_context = NULL;
|
m_context = NULL;
|
||||||
alcCloseDevice(m_device);
|
alcCloseDevice(m_device);
|
||||||
m_device = NULL;
|
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;
|
infostream<<"Audio: Deinitialized."<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user