diff options
author | Chris Dickens <christopher.a.dickens@gmail.com> | 2015-07-28 22:29:11 -0700 |
---|---|---|
committer | Chris Dickens <christopher.a.dickens@gmail.com> | 2015-07-28 23:08:58 -0700 |
commit | 3682baabe07b0280d4556652be95fcebde78b1d6 (patch) | |
tree | a08f399c85671e9cd5ee4037968a543ac1d897f2 | |
parent | c141457debff6156b83786eb69b46d873634e5bd (diff) | |
download | libusb-3682baabe07b0280d4556652be95fcebde78b1d6.tar.gz |
Windows: Destroy autoclaim_lock during cleanup
* Fixes a resource leak during init error handling or final exit
* Closes #76
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
-rw-r--r-- | libusb/os/windows_usb.c | 2 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index ccff8a1..01a4844 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -1069,6 +1069,7 @@ init_exit: // Holds semaphore here. timer_thread_id = 0; } htab_destroy(); + usbi_mutex_destroy(&autoclaim_lock); } if (r != LIBUSB_SUCCESS) @@ -1898,6 +1899,7 @@ static void windows_exit(void) timer_thread_id = 0; } htab_destroy(); + usbi_mutex_destroy(&autoclaim_lock); } ReleaseSemaphore(semaphore, 1, NULL); // increase count back to 1 diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 3ca816b..1ac5e98 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10985 +#define LIBUSB_NANO 10986 |