mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 19:20:46 +00:00
- fixed sound channel iterator to properly handle callbacks that delete sounds.cpp
This commit is contained in:
parent
e28de10c00
commit
c8aa006f82
1 changed files with 4 additions and 1 deletions
|
@ -380,10 +380,13 @@ public:
|
||||||
|
|
||||||
template<class func> bool EnumerateChannels(func callback)
|
template<class func> bool EnumerateChannels(func callback)
|
||||||
{
|
{
|
||||||
for (FSoundChan* chan = Channels; chan; chan = chan->NextChan)
|
FSoundChan* chan = Channels;
|
||||||
|
while (chan)
|
||||||
{
|
{
|
||||||
|
auto next = chan = chan->NextChan;
|
||||||
int res = callback(chan);
|
int res = callback(chan);
|
||||||
if (res) return res > 0;
|
if (res) return res > 0;
|
||||||
|
chan = next;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue