summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-02-26 01:39:11 +0000
committerPete Batard <pbatard@gmail.com>2010-02-26 01:39:11 +0000
commitbdeed5cbbb098cc4a3157216a142d187dfca9712 (patch)
tree63708086d32c60d20d136f280165b51232a2e376
parentfceedd4d307ecc89580aac9d8446e3e903e2ef5a (diff)
downloadlibusb-bdeed5cbbb098cc4a3157216a142d187dfca9712.tar.gz
fixed a typo in usbi_mutex_unlockr179
also added mutex release in libusb_unref_device
-rw-r--r--libusb/core.c1
-rw-r--r--libusb/os/threads_windows.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/libusb/core.c b/libusb/core.c
index 6da729f..da0ca9d 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -831,6 +831,7 @@ API_EXPORTED void libusb_unref_device(libusb_device *dev)
usbi_mutex_lock(&dev->ctx->usb_devs_lock);
list_del(&dev->list);
usbi_mutex_unlock(&dev->ctx->usb_devs_lock);
+ usbi_mutex_destroy(&dev->lock);
free(dev);
}
diff --git a/libusb/os/threads_windows.c b/libusb/os/threads_windows.c
index 11b55f9..da49eec 100644
--- a/libusb/os/threads_windows.c
+++ b/libusb/os/threads_windows.c
@@ -62,7 +62,7 @@ int usbi_mutex_lock(usbi_mutex_t *mutex) {
}
int usbi_mutex_unlock(usbi_mutex_t *mutex) {
if(!mutex) return ((errno=EINVAL));
- if(!ReleaseMutex(mutex)) return ((errno=EPERM ));
+ if(!ReleaseMutex(*mutex)) return ((errno=EPERM ));
return 0;
}