darwin: After last CFRelease of struct field, set it to NULL
authorSean McBride <sean@rogue-research.com>
Fri, 20 Aug 2021 19:57:52 +0000 (15:57 -0400)
committerTormod Volden <debian.tormod@gmail.com>
Sat, 30 Oct 2021 13:23:45 +0000 (15:23 +0200)
Other code checks this field for being NULL or not, so NULLing it upon
last release seems the right thing to do.  I noticed this during code
review, I never actually reproduced any problem.

Closes #981

libusb/os/darwin_usb.c
libusb/version_nano.h

index 485eb43..a2da0cf 100644 (file)
@@ -1570,6 +1570,7 @@ static int darwin_release_interface(struct libusb_device_handle *dev_handle, uin
   if (cInterface->cfSource) {
     CFRunLoopRemoveSource (libusb_darwin_acfl, cInterface->cfSource, kCFRunLoopDefaultMode);
     CFRelease (cInterface->cfSource);
+    cInterface->cfSource = NULL;
   }
 
   kresult = (*(cInterface->interface))->USBInterfaceClose(cInterface->interface);
index 7bbbe39..b82862d 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11662
+#define LIBUSB_NANO 11663