From b7333c0664ad350b1dc6b0fc72586059881f1730 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 2 Oct 2018 23:31:28 +1000 Subject: [PATCH] [mssql] Use currentThread instead of fragile currentThreadId to ID unique connection names --- src/providers/mssql/qgsmssqlprovider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/mssql/qgsmssqlprovider.cpp b/src/providers/mssql/qgsmssqlprovider.cpp index 69e9f30a44e..c228d6e0f20 100644 --- a/src/providers/mssql/qgsmssqlprovider.cpp +++ b/src/providers/mssql/qgsmssqlprovider.cpp @@ -1503,7 +1503,7 @@ QString QgsMssqlProvider::dbConnectionName( const QString &name ) // Starting with Qt 5.11, sharing the same connection between threads is not allowed. // We use a dedicated connection for each thread requiring access to the database, // using the thread address as connection name. - const QString threadAddress = QStringLiteral( ":0x%1" ).arg( reinterpret_cast< quintptr >( QThread::currentThreadId() ), 16 ); + const QString threadAddress = QStringLiteral( ":0x%1" ).arg( QString::number( reinterpret_cast< quintptr >( QThread::currentThread() ), 16 ) ); return name + threadAddress; }