Skip to content
Permalink
Browse files

[mssql] Use currentThread instead of fragile currentThreadId to ID un…

…ique connection names
  • Loading branch information
nyalldawson committed Oct 2, 2018
1 parent 7243224 commit b7333c0664ad350b1dc6b0fc72586059881f1730
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;
}

0 comments on commit b7333c0

Please sign in to comment.
You can’t perform that action at this time.