Skip to content

Fix dangling device references after successful device opening#8

Open
alexey-lysiuk wants to merge 1 commit intorigexpert:mainfrom
alexey-lysiuk:fix_open_device
Open

Fix dangling device references after successful device opening#8
alexey-lysiuk wants to merge 1 commit intorigexpert:mainfrom
alexey-lysiuk:fix_open_device

Conversation

@alexey-lysiuk
Copy link
Copy Markdown

The same fix as in rigexpert/libfobos#20.

Dangling references to devices prevented further usage of libusb on macOS.
A bunch of the following errors were reported during call to libusb_exit().

libusb: error [darwin_cleanup_devices] device still referenced at libusb_exit
The next call to libusb_init() failed with the following error
libusb: error [darwin_first_time_init] libusb_device reference not released on last exit. will not continue

To reproduce the issue, it's enough to add the second call to get_devinfo() function to fobos_sdr_devinfo_main.c.
Without this change, the second enumeration could not find any devices with FobosSDR connected.

These erroneous references to devices prevented further usage of libusb on macOS
A bunch of the following errors were reported during call to libusb_exit()
> libusb: error [darwin_cleanup_devices] device still referenced at libusb_exit
The next call to libusb_init() failed with the following error
> libusb: error [darwin_first_time_init] libusb_device reference not released on last exit. will not continue

To reproduce the issue, it's enough to add the second call to get_devinfo() function to fobos_sdr_devinfo_main.c
Without this change, the second enumeration could not find any devices with FobosSDR connected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant