From 67f185d40d67f8105bcbad7edd86eb23ed84cd19 Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Fri, 29 Nov 2024 13:59:40 +0100 Subject: [PATCH] Fix possible race condition when closing the wizard --- dashboard/adb.h | 3 +++ dashboard/wizard.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/dashboard/adb.h b/dashboard/adb.h index 05f7b943..664219f2 100644 --- a/dashboard/adb.h +++ b/dashboard/adb.h @@ -90,6 +90,9 @@ private: public: adb(); + adb(const adb &) = delete; + adb & operator=(const adb &) = delete; + const std::vector & devices() const { return _android_devices; diff --git a/dashboard/wizard.cpp b/dashboard/wizard.cpp index 168109ca..c22f476b 100644 --- a/dashboard/wizard.cpp +++ b/dashboard/wizard.cpp @@ -460,6 +460,10 @@ wizard::~wizard() { server->disable_pairing(); + // android_devices_changed can be emitted when adb_service is destroyed, disconnect it before destroying + // the GUI + disconnect(&adb_service, &adb::android_devices_changed, this, &wizard::on_android_device_list_changed); + delete ui; ui = nullptr; }