shithub: m8c

Download patch

ref: dd42e39259e3c367a874448fd79c695c3062acf3
parent: 02edd91075e2f6d92676a3927373384fa12548c1
author: Maido Käära <maido@producement.com>
date: Sat Jan 28 06:31:44 EST 2023

Shut down libusb

--- a/serial.c
+++ b/serial.c
@@ -246,6 +246,23 @@
                      result);
         return -1;
     }
+
+    int rc;
+
+    for (int if_num = 0; if_num < 2; if_num++) {
+        rc = libusb_release_interface(devh, if_num);
+        if (rc < 0) {
+            SDL_Log("Error releasing interface: %s", libusb_error_name(rc));
+            return 0;
+        }
+    }
+
+    if (devh != NULL) {
+        libusb_close(devh);
+    }
+
+    libusb_exit(NULL);
+
     return 1;
 }
 
--