From 936796f4a6198c67c33f462b33d9ddb5daacc3b7 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Thu, 16 May 2013 22:04:18 -0600 Subject: darwin: increment the reference counter to the parent device --- libusb/os/darwin_usb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c index 0e06afb..d4e6b9c 100644 --- a/libusb/os/darwin_usb.c +++ b/libusb/os/darwin_usb.c @@ -865,6 +865,11 @@ static int process_new_device (struct libusb_context *ctx, io_service_t service) dev->bus_number = cached_device->location >> 24; dev->device_address = cached_device->address; + /* need to add a reference to the parent device */ + if (dev->parent_dev) { + libusb_ref_device(dev->parent_dev); + } + (*(priv->dev->device))->GetDeviceSpeed (priv->dev->device, &devSpeed); switch (devSpeed) { -- cgit v1.2.1