Commit 0efdb6cd authored by Christian Kandeler's avatar Christian Kandeler

SSH: Fix race condition.

Change-Id: I4f52a2b604db14d088f2416989a502f91a16deab
Reviewed-on: http://codereview.qt.nokia.com/1237Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 8bddd27a
......@@ -48,6 +48,7 @@
#include <QtCore/QFile>
#include <QtCore/QMutex>
#include <QtCore/QMutexLocker>
#include <QtNetwork/QNetworkProxy>
#include <QtNetwork/QTcpSocket>
......@@ -70,15 +71,12 @@ namespace {
void doStaticInitializationsIfNecessary()
{
QMutexLocker locker(&staticInitMutex);
if (!staticInitializationsDone) {
staticInitMutex.lock();
if (!staticInitializationsDone) {
Botan::LibraryInitializer::initialize("thread_safe=true");
qRegisterMetaType<Utils::SshError>("Utils::SshError");
qRegisterMetaType<Utils::SftpJobId>("Utils::SftpJobId");
staticInitializationsDone = true;
}
staticInitMutex.unlock();
Botan::LibraryInitializer::initialize("thread_safe=true");
qRegisterMetaType<Utils::SshError>("Utils::SshError");
qRegisterMetaType<Utils::SftpJobId>("Utils::SftpJobId");
staticInitializationsDone = true;
}
}
} // anonymous namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment