Open diablodale opened 1 year ago
The question is why would there be a null entry in this list (other than the terminating null - it is a null-terminated list). The code in usb_host.cpp looks fine, it retrieves the list, iterates over it and frees it without modifying it.
Can you please use an assert instead of "continue" here? https://github.com/luxonis/XLink/blob/d209b7eeb8ac68435df5097e57e1dfd8ea1d0e83/src/pc/protocols/usb_host.cpp#L126
I was looking in the wrong file. wrap_libusb.hpp is a lot more scary.
@tormodvolden, do you have a bug to report? If so, please open a new bug with: description, setup, repro steps, actual results, and expected results.
libusb_free_device_list(ptr, 1)
does not handle the scenario of havingnull
entries in the device list. It will errantly stop its unref walk of the list thinking it has reached the terminatingnull
. https://github.com/libusb/libusb/issues/1287Fix now in my fork of Xlink. Will auto link to the commit below.