Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure cleanup on hotplug_libusb shutdown
Make sure the hotplug_libusb cleanup code is executed on all exit branches from the thread. This prevents memory and resource leaks on these codepaths. Before the commit, it was possible that the cleanup code in HPRescanUsbBus() would be skipped if the caller (HPEstablishUSBNotifications()) decides to exit on its own. Also libusb_exit() was skipped in some branches. The commit moves the cleanup code to the end of HPEstablishUSBNotifications() and removes pthread_exit() from HPRescanUsbBus(), so that cleanup isn't skipped.
- Loading branch information