viktorgino / headunit-desktop

HeadUnit Desktop is a car PC software built with Qt 5 and QML
https://github.com/viktorgino/headunit-desktop/wiki
GNU General Public License v3.0
285 stars 64 forks source link

Fix: USB Connection Listener CPU #66

Closed aselafernando closed 2 years ago

aselafernando commented 2 years ago

libusb_handle_events_timeout_completed always returns (non-blocking). libusb_handle_events_completed will block for 60s. Calling libusb_hotplug_deregister_callback will trigger libusb_handle_events_completed. Hence why stop() must be called before libusb_hotplug_deregister_callback.

http://libusbx.sourceforge.net/api-1.0/group__asyncio.html#asyncevent

This resolves #64

viktorgino commented 2 years ago

Nice one @aselafernando, thanks