mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
fix infinite recursion when using SDL_mixer v2.6
Mix_HaltChannel -> soundFinishedCallback -> Mix_FreeChunk -> soundFinishedCallback -> ...
This commit is contained in:
committed by
Andrii Danylchenko
parent
0429ff61b0
commit
f2187f6767
@@ -257,13 +257,14 @@ void CSoundHandler::soundFinishedCallback(int channel)
|
||||
{
|
||||
std::map<int, std::function<void()> >::iterator iter;
|
||||
iter = callbacks.find(channel);
|
||||
if (iter == callbacks.end())
|
||||
return;
|
||||
|
||||
assert(iter != callbacks.end());
|
||||
|
||||
if (iter->second)
|
||||
iter->second();
|
||||
|
||||
auto callback = std::move(iter->second);
|
||||
callbacks.erase(iter);
|
||||
|
||||
if (callback)
|
||||
callback();
|
||||
}
|
||||
|
||||
int CSoundHandler::ambientGetRange() const
|
||||
|
Reference in New Issue
Block a user