From ab1b3843bfd544daa5f907d7b9b4c35dce9411dc Mon Sep 17 00:00:00 2001 From: Simon Haggett Date: Tue, 10 Jul 2012 16:07:45 +0100 Subject: [PATCH] Windows: usbi_cond_destroy() should free handles created by usbi_cond_intwait(). * Without this change every call to usbi_cond_destroy() leaks an event handle. --- libusb/os/threads_windows.c | 1 + libusb/version_nano.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libusb/os/threads_windows.c b/libusb/os/threads_windows.c index aa05edc..db83a4d 100644 --- a/libusb/os/threads_windows.c +++ b/libusb/os/threads_windows.c @@ -97,6 +97,7 @@ int usbi_cond_destroy(usbi_cond_t *cond) { if(!list_empty(&cond->waiters)) return ((errno=EBUSY )); // (!see above!) list_for_each_entry(pos, &cond->not_waiting, list, struct usbi_cond_perthread) { free(prev_pos); + CloseHandle(pos->event); list_del(&pos->list); prev_pos = pos; } diff --git a/libusb/version_nano.h b/libusb/version_nano.h index e6ad1ad..7238e56 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10538 +#define LIBUSB_NANO 10539 -- 2.7.4