diff options
author | Craig Hutchinson <54269136+CraigHutchinson@users.noreply.github.com> | 2022-04-13 12:03:52 +0100 |
---|---|---|
committer | Nathan Hjelm <hjelmn@google.com> | 2022-04-13 08:47:50 -0600 |
commit | a8f8d4ba3dc897ed602d3b03d9843095e9a871b0 (patch) | |
tree | 9d78f75a050e456499bc469144615829b71e846a | |
parent | 4239bc3a50014b8e6a5a2a59df1fff3b7469543b (diff) | |
download | libusb-a8f8d4ba3dc897ed602d3b03d9843095e9a871b0.tar.gz |
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>
-rw-r--r-- | libusb/core.c | 4 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 4 insertions, 2 deletions
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 @@ void API_EXPORTED libusb_exit(libusb_context *ctx) 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 @@ void API_EXPORTED libusb_exit(libusb_context *ctx) /* 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 |