From 524cbfadac1ed8fa01bed877e489d521e5dca3ad Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Sat, 1 Mar 2025 09:28:33 -0300 Subject: [PATCH] Avoid QSoundEffect var out of scope too early The object was destroyed and play interrupted --- src/Train/TrainSidebar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Train/TrainSidebar.cpp b/src/Train/TrainSidebar.cpp index d2c67a9f1..3b4123c23 100644 --- a/src/Train/TrainSidebar.cpp +++ b/src/Train/TrainSidebar.cpp @@ -2083,7 +2083,7 @@ void TrainSidebar::guiUpdate() // refreshes the telemetry if (fPlayAudio) { lapAudioThisLap = false; #if QT_VERSION >= 0x060000 - QSoundEffect effect; + static QSoundEffect effect; effect.setSource(QUrl::fromLocalFile(":audio/lap.wav")); effect.play(); #else