commit | afadbc7a89f49b70a09d0d809853777ce3a135bf | [log] [tgz] |
---|---|---|
author | Nathan Hjelm <hjelmn@google.com> | Tue Aug 13 21:11:15 2019 -0700 |
committer | Nathan Hjelm <hjelmn@google.com> | Tue Aug 13 21:22:48 2019 -0700 |
tree | 11e1e75439095df39654a954bdf2a87ef9894931 | |
parent | a5990ab10f68e5ec7498f627d1664b1f842fec4e [diff] |
core: abandon sync transfers after libusb_close() This commit adds an additional check to synchronous transfer progression to prevent accessing a potentially deleted context. This access can occur if a code calls libusb_close() then libusb_exit() from one thread while another thread is in a synchronous transfer. Note that this is likely a user error. The application should wait for all transfers to complete before calling libusb_close(). This commit is being offered as a best-effort attempt to prevent the invalid access and return a useful error to the application. There may still be a window where an invalid access is possible. This commit is a work around until a better fix is available. References #610 Signed-off-by: Nathan Hjelm <hjelmn@google.com>
libusb is a library for USB device access from Linux, macOS, Windows, OpenBSD/NetBSD and Haiku userspace. It is written in C (Haiku backend in C++) and licensed under the GNU Lesser General Public License version 2.1 or, at your option, any later version (see COPYING).
libusb is abstracted internally in such a way that it can hopefully be ported to other operating systems. Please see the PORTING file for more information.
libusb homepage: http://libusb.info/
Developers will wish to consult the API documentation: http://api.libusb.info
Use the mailing list for questions, comments, etc: http://mailing-list.libusb.info
(Please use the mailing list rather than mailing developers directly)