From 2422ec7c126a83b79cccee60a3002a544016befe Mon Sep 17 00:00:00 2001 From: Barinade Date: Sun, 22 Sep 2019 02:35:45 -0500 Subject: [PATCH] Add checkpoint to Soundman position setter just in case this causes a crash down the line --- src/Etterna/Singletons/GameSoundManager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Etterna/Singletons/GameSoundManager.cpp b/src/Etterna/Singletons/GameSoundManager.cpp index 8169faa1e2..b1c6dac401 100644 --- a/src/Etterna/Singletons/GameSoundManager.cpp +++ b/src/Etterna/Singletons/GameSoundManager.cpp @@ -395,10 +395,11 @@ GameSoundManager::HandleSetPosition() vector vec = g_PositionsToSet; g_PositionsToSet.clear(); g_Mutex->Unlock(); - if (!vec.empty()) { - for (unsigned i = 0; i < vec.size(); i++) { - vec[i].m_psound->SetPositionSeconds(vec[i].fSeconds); - } + for (unsigned i = 0; i < vec.size(); i++) { + // I wonder if this can crash when sounds get deleted + // only one way to find out - checkpoint and see if someone crashes :) + CHECKPOINT_M("Setting position for sound."); + vec[i].m_psound->SetPositionSeconds(vec[i].fSeconds); } }