Skip to content

Commit

Permalink
989snd: fix missing locking
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziemas committed Nov 11, 2023
1 parent 28f9304 commit 8152cfd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions game/sound/989snd/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ void player::set_sound_vol_pan(s32 sound_id, s32 vol, s32 pan) {
}

void player::set_sound_pmod(s32 sound_handle, s32 mod) {
std::scoped_lock lock(m_ticklock);
auto handler = m_handlers.find(sound_handle);
if (handler == m_handlers.end())
return;
Expand All @@ -318,6 +319,7 @@ void player::set_sound_pmod(s32 sound_handle, s32 mod) {
}

void player::stop_all_sounds() {
std::scoped_lock lock(m_ticklock);
for (auto it = m_handlers.begin(); it != m_handlers.end();) {
m_handle_allocator.free_id(it->first);
it = m_handlers.erase(it);
Expand Down

0 comments on commit 8152cfd

Please sign in to comment.