From d097768e1fe1d070d75100808543272737dd1e11 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 7 Aug 2019 23:02:49 +0200 Subject: AUDIO: (FM-Towns/PC-98) - deconstructor/race condition fix (move mixer calls before mutex lock, since the mixer has a mutex of its own) --- audio/softsynth/fmtowns_pc98/pc98_audio.cpp | 2 +- audio/softsynth/fmtowns_pc98/towns_audio.cpp | 2 +- audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'audio') 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; } -- cgit v1.2.3