From 5506512dae682f733c55f59d9802a0ff12369822 Mon Sep 17 00:00:00 2001 From: tihmstar Date: Thu, 14 Dec 2023 01:16:00 +0100 Subject: IOKit: Fix race condition when trying to delete runloop before it even started --- src/libirecovery.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libirecovery.c') diff --git a/src/libirecovery.c b/src/libirecovery.c index 3146e40..a38b55f 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c @@ -3114,6 +3114,7 @@ irecv_error_t irecv_device_event_unsubscribe(irecv_device_event_context_t contex if (num == 0 && th_event_handler != THREAD_T_NULL && thread_alive(th_event_handler)) { #ifdef HAVE_IOKIT if (iokit_runloop) { + while (!CFRunLoopIsWaiting(iokit_runloop)) usleep(420); CFRunLoopStop(iokit_runloop); iokit_runloop = NULL; } -- cgit v1.1-32-gdbae