From e08c1303ef9d89ca011da322149133c4c339d7ed Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 19 Feb 2025 09:43:51 +1000 Subject: [PATCH] Fix a bug with the deviceio test. --- tests/test_deviceio/ma_test_deviceio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_deviceio/ma_test_deviceio.c b/tests/test_deviceio/ma_test_deviceio.c index 495066e8..effc0027 100644 --- a/tests/test_deviceio/ma_test_deviceio.c +++ b/tests/test_deviceio/ma_test_deviceio.c @@ -594,7 +594,7 @@ int main(int argc, char** argv) } /* Now we just keep looping and wait for user input. */ - while (!g_State.wantsToClose) { + for (;;) { if (interactive) { int c; @@ -630,6 +630,10 @@ int main(int argc, char** argv) } } else { /* Running in auto-close mode. Just sleep for a bit. The data callback will control when this loop aborts. */ + if (g_State.wantsToClose) { + break; + } + ma_sleep(10); } }