From 38eafeb0cfb12fcd0a89c47927fa6924452a641d Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Wed, 29 Dec 2021 17:03:44 +0200 Subject: [PATCH] Never deadlock ever again thanks --- Cocoa/Document.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cocoa/Document.m b/Cocoa/Document.m index e6b6599..ab7ad67 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -390,7 +390,7 @@ static void infraredStateChanged(GB_gameboy_t *gb, bool on) if (audioBufferPosition < nFrames) { audioBufferNeeded = nFrames; - [audioLock wait]; + [audioLock waitUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.125]]; } if (stopping || GB_debugger_is_stopped(&gb)) {