Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions can/interfaces/gs_usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,6 @@ def shutdown(self):
gs_usb.stop()
except usb.core.USBError:
pass
finally:
usb.util.dispose_resources(gs_usb.gs_usb)
usb.util.dispose_resources(self.gs_usb.gs_usb)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of this repetition, i'd prefer a try-finally around the whole function body.