mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-23 21:05:44 +03:00
Attempt to fix the Account::slotHandleSslErrors crash
Events from the crash reporter suggest that the QNAM and its child replies might get deleted before returning from this method and the only possible cause we can see is that the inner event loop has something to do with it. Try keeping a ref on the QNAM while in this method to make sure that it won't get deleted by the inner event loop.
This commit is contained in:
parent
d40c56eda5
commit
147cf798a6
1 changed files with 6 additions and 0 deletions
|
@ -427,6 +427,12 @@ void Account::slotHandleSslErrors(QNetworkReply *reply , QList<QSslError> errors
|
|||
return;
|
||||
}
|
||||
|
||||
// SslDialogErrorHandler::handleErrors will run an event loop that might execute
|
||||
// the deleteLater() of the QNAM before we have the chance of unwinding our stack.
|
||||
// Keep a ref here on our stackframe to make sure that it doesn't get deleted before
|
||||
// handleErrors returns.
|
||||
QSharedPointer<QNetworkAccessManager> qnamLock = _am;
|
||||
|
||||
if (_sslErrorHandler->handleErrors(errors, reply->sslConfiguration(), &approvedCerts, sharedFromThis())) {
|
||||
QSslSocket::addDefaultCaCertificates(approvedCerts);
|
||||
addApprovedCerts(approvedCerts);
|
||||
|
|
Loading…
Reference in a new issue