mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-06 00:05:02 -05:00
[mssql] Use currentThread instead of fragile currentThreadId to ID unique connection names
This commit is contained in:
parent
72432246a1
commit
b7333c0664
@ -1503,7 +1503,7 @@ QString QgsMssqlProvider::dbConnectionName( const QString &name )
|
|||||||
// Starting with Qt 5.11, sharing the same connection between threads is not allowed.
|
// 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,
|
// We use a dedicated connection for each thread requiring access to the database,
|
||||||
// using the thread address as connection name.
|
// 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;
|
return name + threadAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user