Avoid QSoundEffect var out of scope too early

The object was destroyed and play interrupted
This commit is contained in:
Alejandro Martinez
2025-03-01 09:28:33 -03:00
parent baa44965e3
commit 524cbfadac

View File

@@ -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