Properly define relation between hid_exit and hid_deregister_callback #786
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi#786
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
One of the cases are mentioned by @Copilot https://github.com/libusb/hidapi/pull/674#discussion_r2870009025_
But the problem is more general: there is no clear definition how
hid_exitandhid_deregister_callbackare related to each other: shouldhid_exitautomatically deregister all callbacks or should user be forced to deregister all callbacks beforehid_exit?I vote for automatic cleanup.
We need to consider all options, there are also devices, which needs to be closed before exit - and it is not possible to close those safely automatically. Even though deregistering callback automatically is possible - it makes inconsistent behavior between two similar cases.