diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2017-03-28 16:11:58 +0300 |
---|---|---|
committer | Markus Goetz <markus@woboq.com> | 2017-03-28 19:04:19 +0300 |
commit | 85afa4788b7ad16d1959a9660ba16b4393601345 (patch) | |
tree | c7f071092c218421ad26ada168e8960d7a3f26fe /src/gui/accountstate.cpp | |
parent | 3ca071c612a39f63e57285bccfd95974828d2bbd (diff) |
AccountState: Attempt to fix a crash
Backtrace from the crash reporter:
Crash: EXCEPTION_ACCESS_VIOLATION_READ at 0x21
File "qcoreapplication.cpp", line 1281, in QCoreApplication::postEvent
File "qobject.cpp", line 2125, in QObject::deleteLater
File "connectionvalidator.cpp", line 240, in OCC::ConnectionValidator::reportResult
File "connectionvalidator.cpp", line 206, in OCC::ConnectionValidator::slotAuthFailed
File "moc_connectionvalidator.cpp", line 127, in OCC::ConnectionValidator::qt_static_metacall
File "qobject.cpp", line 3716, in QMetaObject::activate
File "moc_networkjobs.cpp", line 653, in OCC::PropfindJob::finishedWithError
File "networkjobs.cpp", line 570, in OCC::PropfindJob::finished
I believe the problem is caused because 'this' was deleted in ConnectionValidator::reportResult
as the signal connectionResult gets emited. The AccountState::slotConnectionValidatorResult
slot does indeed call slotInvalidCredentials which might call {Shibboleth,Http}Credentials::fetchFromKeychain
which might emit fetched directly, which will call AccountState::slotCredentialsFetched
which deletes the _connectionValidator
So use deleteLater when deleting the _connectionValidator, hoping this helps
Diffstat (limited to 'src/gui/accountstate.cpp')
-rw-r--r-- | src/gui/accountstate.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index 38bae16a9..fb2dc5360 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -281,9 +281,12 @@ void AccountState::slotCredentialsFetched(AbstractCredentials* credentials) _waitingForNewCredentials = false; - // When new credentials become available we always want to restart the - // connection validation, even if it's currently running. - delete _connectionValidator; + if (_connectionValidator) { + // When new credentials become available we always want to restart the + // connection validation, even if it's currently running. + _connectionValidator->deleteLater(); + _connectionValidator = 0; + } checkConnectivity(); } @@ -298,9 +301,12 @@ void AccountState::slotCredentialsAsked(AbstractCredentials* credentials) return; } - // When new credentials become available we always want to restart the - // connection validation, even if it's currently running. - delete _connectionValidator; + if (_connectionValidator) { + // When new credentials become available we always want to restart the + // connection validation, even if it's currently running. + _connectionValidator->deleteLater(); + _connectionValidator = 0; + } checkConnectivity(); } |