From 662ced422cf1ffce68753296a81dccf87f3a1c57 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Fri, 9 Dec 2011 13:43:46 -0500 Subject: [PATCH] Darwin: Use retained runloop variable instead of CFRunLoopGetCurrent() --- libusb/os/darwin_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c index ca93ad4..58c4c88 100644 --- a/libusb/os/darwin_usb.c +++ b/libusb/os/darwin_usb.c @@ -339,7 +339,7 @@ static void *event_thread_main (void *arg0) { /* add the notification port to the run loop */ libusb_notification_port = IONotificationPortCreate (kIOMasterPortDefault); libusb_notification_cfsource = IONotificationPortGetRunLoopSource (libusb_notification_port); - CFRunLoopAddSource(CFRunLoopGetCurrent (), libusb_notification_cfsource, kCFRunLoopDefaultMode); + CFRunLoopAddSource(runloop, libusb_notification_cfsource, kCFRunLoopDefaultMode); /* create notifications for removed devices */ kresult = IOServiceAddMatchingNotification (libusb_notification_port, kIOTerminatedNotification, @@ -359,7 +359,7 @@ static void *event_thread_main (void *arg0) { usbi_info (ctx, "thread ready to receive events"); /* let the main thread know about the async runloop */ - libusb_darwin_acfl = CFRunLoopGetCurrent (); + libusb_darwin_acfl = runloop; /* signal the main thread */ pthread_mutex_lock (&libusb_darwin_at_mutex); -- 2.11.4.GIT