[Scummvm-git-logs] scummvm master -> ed297b4e4d4e54e3e3299c192240b7689e73ce2e
athrxx
athrxx at scummvm.org
Wed Aug 7 22:36:51 CEST 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ed297b4e4d SCI: (FB01 sound driver) - fix potential lockup
Commit: ed297b4e4d4e54e3e3299c192240b7689e73ce2e
https://github.com/scummvm/scummvm/commit/ed297b4e4d4e54e3e3299c192240b7689e73ce2e
Author: athrxx (athrxx at scummvm.org)
Date: 2019-08-07T22:36:12+02:00
Commit Message:
SCI: (FB01 sound driver) - fix potential lockup
(add another mutex lock)
Changed paths:
engines/sci/sound/drivers/fb01.cpp
diff --git a/engines/sci/sound/drivers/fb01.cpp b/engines/sci/sound/drivers/fb01.cpp
index b083461..7f163a5 100644
--- a/engines/sci/sound/drivers/fb01.cpp
+++ b/engines/sci/sound/drivers/fb01.cpp
@@ -159,6 +159,8 @@ MidiPlayer_Fb01::MidiPlayer_Fb01(SciVersion version) : MidiPlayer(version), _pla
}
MidiPlayer_Fb01::~MidiPlayer_Fb01() {
+ if (_driver)
+ _driver->setTimerCallback(NULL, NULL);
Common::StackLock lock(_mutex);
close();
delete _driver;
@@ -526,6 +528,7 @@ void MidiPlayer_Fb01::midiTimerCallback(void *p) {
}
void MidiPlayer_Fb01::setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) {
+ Common::StackLock lock(_mutex);
_driver->setTimerCallback(NULL, NULL);
_timerParam = timer_param;
@@ -635,9 +638,12 @@ int MidiPlayer_Fb01::open(ResourceManager *resMan) {
}
void MidiPlayer_Fb01::close() {
+ if (_driver)
+ _driver->setTimerCallback(NULL, NULL);
Common::StackLock lock(_mutex);
_isOpen = false;
- _driver->close();
+ if (_driver)
+ _driver->close();
}
void MidiPlayer_Fb01::initTrack(SciSpan<const byte>& header) {
More information about the Scummvm-git-logs
mailing list