From 2e60c283457e71ae6051cc5da8b9eea93e6b6197 Mon Sep 17 00:00:00 2001 From: Fushan Wen Date: Sat, 15 Jul 2023 09:57:20 +0800 Subject: [PATCH] CompositeUploadJob: don't start job if device is disconnected If Qt::QueuedConnection, it's possible for a device to disconnect during the waiting period, so make sure subjobs are not started after the device is disconnected. BUG: 466617 FIXED-IN: 23.04.3 --- core/backends/lan/compositeuploadjob.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/backends/lan/compositeuploadjob.cpp b/core/backends/lan/compositeuploadjob.cpp index 525d6ed95..94c9cfc30 100644 --- a/core/backends/lan/compositeuploadjob.cpp +++ b/core/backends/lan/compositeuploadjob.cpp @@ -67,7 +67,12 @@ void CompositeUploadJob::start() m_running = true; // Give SharePlugin some time to add subjobs - QMetaObject::invokeMethod(this, "startNextSubJob", Qt::QueuedConnection); + QMetaObject::invokeMethod( + Daemon::instance()->getDevice(m_deviceId), + [this] { + startNextSubJob(); + }, + Qt::QueuedConnection); } bool CompositeUploadJob::startListening()