From dfb5c0723f69413ddf7a6bf05fb493a119031268 Mon Sep 17 00:00:00 2001 From: Chris Dickens Date: Mon, 27 Apr 2015 01:40:50 -0700 Subject: [PATCH] Windows: Remove erroneous call to CloseHandle and add comments Signed-off-by: Chris Dickens --- libusb/os/windows_usb.c | 3 ++- libusb/version_nano.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index 6a16f28..3c512f0 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -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)) { diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 56497cd..4ecbd70 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10969 +#define LIBUSB_NANO 10970 -- 2.7.4