From 6cf52b515dc950f69c000929bc588d5653169f20 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Sun, 22 Sep 2019 22:11:53 +0100 Subject: QUEEN: Prevent hang when closing core during dialog Co-authored-by: jdgleaver --- engines/queen/sound.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/queen/sound.cpp b/engines/queen/sound.cpp index d715d3737e..85c1f82bf0 100644 --- a/engines/queen/sound.cpp +++ b/engines/queen/sound.cpp @@ -289,7 +289,9 @@ void PCSound::playSound(const char *base, bool isSpeech) { } strcat(name, ".SB"); if (isSpeech) { - while (_mixer->isSoundHandleActive(_speechHandle)) { + // Add _vm->shouldQuit() check here, otherwise game gets stuck + // in an infinite loop if we try to quit while a sound is playing... + while (_mixer->isSoundHandleActive(_speechHandle) && !_vm->shouldQuit()) { _vm->input()->delay(10); } } else { -- cgit v1.2.3