Skip to content

Commit 5506512

Browse files
tihmstarnikias
authored andcommitted
IOKit: Fix race condition when trying to delete runloop before it even started
1 parent 7a84cd9 commit 5506512

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libirecovery.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3114,6 +3114,7 @@ irecv_error_t irecv_device_event_unsubscribe(irecv_device_event_context_t contex
31143114
if (num == 0 && th_event_handler != THREAD_T_NULL && thread_alive(th_event_handler)) {
31153115
#ifdef HAVE_IOKIT
31163116
if (iokit_runloop) {
3117+
while (!CFRunLoopIsWaiting(iokit_runloop)) usleep(420);
31173118
CFRunLoopStop(iokit_runloop);
31183119
iokit_runloop = NULL;
31193120
}

0 commit comments

Comments
 (0)