Windows: usbi_cond_destroy() should free handles created by usbi_cond_intwait().
authorSimon Haggett <simon.haggett@realvnc.com>
Tue, 10 Jul 2012 15:07:45 +0000 (16:07 +0100)
committerPete Batard <pete@akeo.ie>
Tue, 17 Jul 2012 17:05:20 +0000 (18:05 +0100)
* Without this change every call to usbi_cond_destroy() leaks an event handle.

libusb/os/threads_windows.c
libusb/version_nano.h

index aa05edc..db83a4d 100644 (file)
@@ -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;
        }
index e6ad1ad..7238e56 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 10538
+#define LIBUSB_NANO 10539