Fix `exit` order to match reverse of `init`
This commit resolve the ordering of 'exit' dependencies as was started for 'init' in https://github.com/libusb/libusb/commit/0846456f3a9fda8ff5469d9d0b9700837ff16f04
(Relates to https://github.com/xloem/libusb/pull/5)
Closes #1126
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
diff --git a/libusb/core.c b/libusb/core.c
index ec429b7..7c56737 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -2432,6 +2432,9 @@
list_del(&_ctx->list);
usbi_mutex_static_unlock(&active_contexts_lock);
+ /* Exit hotplug before backend dependency */
+ usbi_hotplug_exit(_ctx);
+
if (usbi_backend.exit)
usbi_backend.exit(_ctx);
@@ -2445,7 +2448,6 @@
/* Don't bother with locking after this point because unless there is
* an application bug, nobody will be accessing the context. */
- usbi_hotplug_exit(_ctx);
usbi_io_exit(_ctx);
for_each_device(_ctx, dev) {
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index dbd5d5f..b7c17a1 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11724
+#define LIBUSB_NANO 11725