mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-26 12:48:16 +00:00
AGOS: attempt to fix bug no. 12617 ("AGOS: Deadlock when shutting down game")
I have also made the necessary changes to the PC-98 audio drivers which were written to work around the current situation, but now also need a different order in the destructors.
This commit is contained in:
parent
dda5f4e98b
commit
4a6dbc73db
@ -315,10 +315,10 @@ int PC98FMDriver::open() {
|
||||
}
|
||||
|
||||
void PC98FMDriver::close() {
|
||||
setTimerCallback(0, 0);
|
||||
_isOpen = false;
|
||||
delete _pc98a;
|
||||
_pc98a = 0;
|
||||
setTimerCallback(0, 0);
|
||||
}
|
||||
|
||||
void PC98FMDriver::noteOn(uint8 part, uint8 note, uint8 velo) {
|
||||
@ -610,16 +610,17 @@ int PC98MidiDriver::open() {
|
||||
}
|
||||
|
||||
void PC98MidiDriver::close() {
|
||||
setTimerCallback(0, 0);
|
||||
_isOpen = false;
|
||||
if (!_drv)
|
||||
return;
|
||||
|
||||
_drv->setTimerCallback(0, 0);
|
||||
_mixer->stopAll();
|
||||
_drv->close();
|
||||
delete _drv;
|
||||
_drv = 0;
|
||||
if (_drv) {
|
||||
_drv->setTimerCallback(0, 0);
|
||||
_mixer->stopAll();
|
||||
_drv->close();
|
||||
delete _drv;
|
||||
_drv = 0;
|
||||
}
|
||||
|
||||
setTimerCallback(0, 0);
|
||||
}
|
||||
|
||||
void PC98MidiDriver::timerCallback(void *obj) {
|
||||
|
@ -77,13 +77,14 @@ MidiPlayer::MidiPlayer() {
|
||||
MidiPlayer::~MidiPlayer() {
|
||||
stop();
|
||||
|
||||
Common::StackLock lock(_mutex);
|
||||
if (_driver) {
|
||||
_driver->setTimerCallback(0, 0);
|
||||
_driver->close();
|
||||
delete _driver;
|
||||
}
|
||||
_driver = NULL;
|
||||
|
||||
Common::StackLock lock(_mutex);
|
||||
clearConstructs();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user