mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-29 20:28:57 +03:00
Account: Fix crash when deleting an account
We should not have request parented to the account, otherwise we might get a loop on the deletion order. Issue #6893
This commit is contained in:
parent
6b0bb66b17
commit
7c1871ae65
2 changed files with 5 additions and 2 deletions
|
@ -54,6 +54,9 @@ AbstractNetworkJob::AbstractNetworkJob(AccountPtr account, const QString &path,
|
|||
, _reply(nullptr)
|
||||
, _path(path)
|
||||
{
|
||||
// Since we hold a QSharedPointer to the account, this makes no sense. (issue #6893)
|
||||
ASSERT(account != parent);
|
||||
|
||||
_timer.setSingleShot(true);
|
||||
_timer.setInterval((httpTimeout ? httpTimeout : 300) * 1000); // default to 5 minutes.
|
||||
connect(&_timer, &QTimer::timeout, this, &AbstractNetworkJob::slotTimeout);
|
||||
|
|
|
@ -294,7 +294,7 @@ QNetworkReply *Account::sendRawRequest(const QByteArray &verb, const QUrl &url,
|
|||
|
||||
SimpleNetworkJob *Account::sendRequest(const QByteArray &verb, const QUrl &url, QNetworkRequest req, QIODevice *data)
|
||||
{
|
||||
auto job = new SimpleNetworkJob(sharedFromThis(), this);
|
||||
auto job = new SimpleNetworkJob(sharedFromThis());
|
||||
job->startRequest(verb, url, req, data);
|
||||
return job;
|
||||
}
|
||||
|
@ -621,7 +621,7 @@ void Account::fetchDirectEditors(const QUrl &directEditingURL, const QString &di
|
|||
if (!directEditingURL.isEmpty() &&
|
||||
(directEditingETag.isEmpty() || directEditingETag != _lastDirectEditingETag)) {
|
||||
// Fetch the available editors and their mime types
|
||||
auto *job = new JsonApiJob(sharedFromThis(), QLatin1String("ocs/v2.php/apps/files/api/v1/directEditing"), this);
|
||||
auto *job = new JsonApiJob(sharedFromThis(), QLatin1String("ocs/v2.php/apps/files/api/v1/directEditing"));
|
||||
QObject::connect(job, &JsonApiJob::jsonReceived, this, &Account::slotDirectEditingRecieved);
|
||||
job->start();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue