Windows: Fix early abort in libusb_close
authorPete Batard <pete@akeo.ie>
Wed, 3 Oct 2012 22:52:16 +0000 (23:52 +0100)
committerPete Batard <pete@akeo.ie>
Wed, 3 Oct 2012 22:52:16 +0000 (23:52 +0100)
* We're calling winusbx_close with SUB_API_NOTSET, so
  we should attempt to initialize it first.
* Issue reported by Ramon Zambelli and Frank Hibbeln

libusb/os/windows_usb.c
libusb/version_nano.h

index fce4d43..332a368 100644 (file)
@@ -2594,6 +2594,8 @@ static void winusbx_close(int sub_api, struct libusb_device_handle *dev_handle)
        HANDLE file_handle;
        int i;
 
+       if (sub_api == SUB_API_NOTSET)
+               sub_api = priv->sub_api;
        if (!WinUSBX[sub_api].initialized)
                return;
 
index 9c8b259..7cb278e 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 10576
+#define LIBUSB_NANO 10577