Windows: Remove erroneous call to CloseHandle and add comments
authorChris Dickens <christopher.a.dickens@gmail.com>
Mon, 27 Apr 2015 08:40:50 +0000 (01:40 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Mon, 27 Apr 2015 08:44:34 +0000 (01:44 -0700)
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/windows_usb.c
libusb/version_nano.h

index 6a16f28..3c512f0 100644 (file)
@@ -1012,6 +1012,8 @@ static int windows_init(struct libusb_context *ctx)
                                usbi_err(ctx, "could not get process affinity: %s", windows_error_str(0));
                                goto init_exit;
                        }
+                       // The process affinity mask is a bitmask where each set bit represents a core on
+                       // which this process is allowed to run, so we find the first set bit
                        for (i = 0; !(affinity & (1 << i)); i++);
                        affinity = (1 << i);
 
@@ -1027,7 +1029,6 @@ static int windows_init(struct libusb_context *ctx)
                                0, (unsigned int *)&timer_thread_id);
                        if (timer_thread == NULL) {
                                usbi_err(ctx, "unable to create timer thread - aborting");
-                               CloseHandle(event);
                                goto init_exit;
                        }
                        if (!SetThreadAffinityMask(timer_thread, affinity)) {
index 56497cd..4ecbd70 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 10969
+#define LIBUSB_NANO 10970