From bf32ae66c60d0401ccbb49031e19cd47e5890fff Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 15 Feb 2020 19:23:04 +0200 Subject: [PATCH] Another attemp to fix Cocoa deadlocking --- Cocoa/Document.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cocoa/Document.m b/Cocoa/Document.m index f7349cc..df15806 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -374,7 +374,9 @@ static void audioCallback(GB_gameboy_t *gb, GB_sample_t *sample) if (GB_debugger_is_stopped(&gb)) { [self interruptDebugInputRead]; } + [audioLock lock]; stopping = true; + [audioLock unlock]; running = false; while (stopping); GB_debugger_set_disabled(&gb, false);