Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix memory leak on sound shutdown
  • Loading branch information
sapier authored and kwolekr committed Apr 8, 2013
1 parent 0d26bb3 commit e7247c1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sound_openal.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit e7247c1

Please sign in to comment.