mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- SW: when an actor is killed, all attached ambient sounds must be deleted.
Not only did the sound not stop but what happened here was very much undefined behavior as the ambient sound retained its pointer to now undefined memory.
This commit is contained in:
parent
11735c2963
commit
0cef35c345
1 changed files with 11 additions and 0 deletions
|
@ -733,6 +733,17 @@ void DeleteNoSoundOwner(DSWActor* actor)
|
|||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// also delete all ambients attached to this actor.
|
||||
for (int i = ambients.Size() - 1; i >= 0; i--)
|
||||
{
|
||||
auto amb = ambients[i];
|
||||
if (amb->spot == actor)
|
||||
{
|
||||
soundEngine->StopSound(SOURCE_Ambient, amb, -1);
|
||||
ambients.Delete(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue