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
This commit is contained in:
Fushan Wen 2023-07-15 09:57:20 +08:00
parent ad13002e54
commit 2e60c28345
No known key found for this signature in database
GPG key ID: 2E48D1487C91DCAA

View file

@ -67,7 +67,12 @@ void CompositeUploadJob::start()
m_running = true; m_running = true;
// Give SharePlugin some time to add subjobs // 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() bool CompositeUploadJob::startListening()