OpenHantek / openhantek

OpenHantek is a DSO software for Hantek (Voltcraft/Darkwire/Protek/Acetech) USB digital signal oscilloscopes
http://openhantek.org/
GNU General Public License v3.0
771 stars 199 forks source link

Reset the device pointer before libusb_exit(). #246

Closed uunicorn closed 6 years ago

uunicorn commented 6 years ago

unique_ptr deletes target pointer when variable scope ends. For variable "device" this is the whole main() function. So Device is destroyed after main() is finished. Device descructor is calling libusb_close. According to documentation no libusb function is allowed to be called after libusb_exit().

Fixes #195