Skip to content

Commit

Permalink
macOS: remove event source on close
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelbl committed Jan 6, 2024
1 parent 92bc7c3 commit 6ecf2bd
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ public synchronized void close() {
return;

for (var interfaceInfo : claimedInterfaces) {
var source = IoKitUsb.GetInterfaceAsyncEventSource(interfaceInfo.iokitInterface());
if (source.address() != 0)
asyncTask.removeEventSource(source);
IoKitUsb.USBInterfaceClose(interfaceInfo.iokitInterface);
IoKitUsb.Release(interfaceInfo.iokitInterface);
setClaimed(interfaceInfo.interfaceNumber, false);
Expand Down

0 comments on commit 6ecf2bd

Please sign in to comment.