aboutsummaryrefslogtreecommitdiff
path: root/libjaylink/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'libjaylink/core.c')
-rw-r--r--libjaylink/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libjaylink/core.c b/libjaylink/core.c
index e2d1e8f..509b89d 100644
--- a/libjaylink/core.c
+++ b/libjaylink/core.c
@@ -143,6 +143,9 @@ JAYLINK_API int jaylink_init(struct jaylink_context **ctx)
ret = jaylink_log_set_domain(context, JAYLINK_LOG_DOMAIN_DEFAULT);
if (ret != JAYLINK_OK) {
+#ifdef HAVE_LIBUSB
+ libusb_exit(context->usb_ctx);
+#endif
#ifdef _WIN32
WSACleanup();
#endif