aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorathrxx2019-08-07 23:02:49 +0200
committerathrxx2019-08-25 11:58:19 +0200
commitd097768e1fe1d070d75100808543272737dd1e11 (patch)
tree11aa54e3a425f8195b65b60bbedb393fbed533c7 /audio
parent5b5a89e3e7b880907f99675a68c5e0a8e2460470 (diff)
downloadscummvm-rg350-d097768e1fe1d070d75100808543272737dd1e11.tar.gz
scummvm-rg350-d097768e1fe1d070d75100808543272737dd1e11.tar.bz2
scummvm-rg350-d097768e1fe1d070d75100808543272737dd1e11.zip
AUDIO: (FM-Towns/PC-98) - deconstructor/race condition fix
(move mixer calls before mutex lock, since the mixer has a mutex of its own)
Diffstat (limited to 'audio')
-rw-r--r--audio/softsynth/fmtowns_pc98/pc98_audio.cpp2
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_audio.cpp2
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp3
3 files changed, 3 insertions, 4 deletions
diff --git a/audio/softsynth/fmtowns_pc98/pc98_audio.cpp b/audio/softsynth/fmtowns_pc98/pc98_audio.cpp
index c8d58f6923..9ab1ec7659 100644
--- a/audio/softsynth/fmtowns_pc98/pc98_audio.cpp
+++ b/audio/softsynth/fmtowns_pc98/pc98_audio.cpp
@@ -80,9 +80,9 @@ PC98AudioCoreInternal::PC98AudioCoreInternal(Audio::Mixer *mixer, PC98AudioCore
}
PC98AudioCoreInternal::~PC98AudioCoreInternal() {
+ deinit();
Common::StackLock lock(_mutex);
_ready = false;
- deinit();
/*
diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.cpp b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
index 1464dd73b7..58a3a804f9 100644
--- a/audio/softsynth/fmtowns_pc98/towns_audio.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
@@ -404,9 +404,9 @@ TownsAudioInterfaceInternal::TownsAudioInterfaceInternal(Audio::Mixer *mixer, To
}
TownsAudioInterfaceInternal::~TownsAudioInterfaceInternal() {
+ deinit();
Common::StackLock lock(_mutex);
_ready = false;
- deinit();
delete[] _fmSaveReg[0];
delete[] _fmSaveReg[1];
diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
index 178d33ef72..0cdf18378d 100644
--- a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
@@ -1347,9 +1347,8 @@ int TownsPC98_FmSynth::getRate() const {
}
void TownsPC98_FmSynth::deinit() {
- Common::StackLock lock(_mutex);
- _ready = false;
_mixer->stopHandle(_soundHandle);
+ _ready = false;
_timers[0].cb = _timers[1].cb = &TownsPC98_FmSynth::idleTimerCallback;
}