Skip to content

Display and control your Android device

Fix USB device leak on connection error

Romain Vimont43ae418752b3
diff --git a/app/src/usb/scrcpy_otg.c b/app/src/usb/scrcpy_otg.c
index 9a7e3fe6..d3a45679 100644
--- a/app/src/usb/scrcpy_otg.c
+++ b/app/src/usb/scrcpy_otg.c
@@ -89,6 +89,8 @@ scrcpy_otg(struct scrcpy_options *options) {
goto end;
}
+ usb_device_initialized = true;
+
LOGI("USB device: %s (%04" PRIx16 ":%04" PRIx16 ") %s %s",
usb_device.serial, usb_device.vid, usb_device.pid,
usb_device.manufacturer, usb_device.product);