o-gs / dji-firmware-tools

Tools for handling firmwares of DJI products, with focus on quadcopters.
GNU General Public License v3.0
1.44k stars 403 forks source link

comm_serialtalk: dispose usb resource in SerialBulkWrap.close() #324

Closed dmytrokulak closed 1 year ago

dmytrokulak commented 1 year ago

This adds implementation for close() method of SerialBulkWrap class by disposing the acquired usb resource.

It prevents the following error if one tries to reuse comm_serialtalk within an application: usb.core.USBError: [Errno None] b'libusb0-dll:err [claim_interface] could not claim interface 4, win error: The requested resource is in use.

mefistotelis commented 1 year ago

Looks good. Thanks.