Use queued connection for "other replies"

so the handler is not called while looping through the
list of these replies to abort them. The handler must
not be called in that situation because it mutates the
list.
This commit is contained in:
Martchus 2020-03-01 23:40:27 +01:00
parent 11834f89d4
commit 5227a7961e
1 changed files with 2 additions and 2 deletions

View File

@ -976,7 +976,7 @@ void SyncthingConnection::requestDirStatus(const QString &dirId)
auto *const reply = requestData(QStringLiteral("db/status"), query);
reply->setProperty("dirId", dirId);
m_otherReplies << reply;
QObject::connect(reply, &QNetworkReply::finished, this, &SyncthingConnection::readDirStatus);
QObject::connect(reply, &QNetworkReply::finished, this, &SyncthingConnection::readDirStatus, Qt::QueuedConnection);
}
/*!
@ -1094,7 +1094,7 @@ void SyncthingConnection::requestCompletion(const QString &devId, const QString
reply->setProperty("devId", devId);
reply->setProperty("dirId", dirId);
m_otherReplies << reply;
QObject::connect(reply, &QNetworkReply::finished, this, &SyncthingConnection::readCompletion);
QObject::connect(reply, &QNetworkReply::finished, this, &SyncthingConnection::readCompletion, Qt::QueuedConnection);
}
/// \cond