QSslSocket (OpenSSL): use QMutexLocker

... instead of naked QMutex::(un)lock().

Change-Id: I9927e60286231bfc254d99cc88c39301b31df336
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
bb10
Marc Mutz 2016-01-17 03:08:01 +01:00
parent 6f7a5b0ecf
commit 8049e9b3b9
1 changed files with 2 additions and 2 deletions

View File

@ -1040,7 +1040,7 @@ bool QSslSocketBackendPrivate::startHandshake()
// Check if the connection has been established. Get all errors from the
// verification stage.
_q_sslErrorList()->mutex.lock();
QMutexLocker locker(&_q_sslErrorList()->mutex);
_q_sslErrorList()->errors.clear();
int result = (mode == QSslSocket::SslClientMode) ? q_SSL_connect(ssl) : q_SSL_accept(ssl);
@ -1056,7 +1056,7 @@ bool QSslSocketBackendPrivate::startHandshake()
}
errorList << lastErrors;
_q_sslErrorList()->mutex.unlock();
locker.unlock();
// Connection aborted during handshake phase.
if (q->state() != QAbstractSocket::ConnectedState)