Skip to content

Commit dae9376

Browse files
committedNov 1, 2018
Tighten scope of connection
(cherry picked from commit c782f27)
1 parent 1f6c9ad commit dae9376

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/core/auth/qgsauthmanager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ QSqlDatabase QgsAuthManager::authDatabaseConnection() const
140140
// triggers a condition in QSqlDatabase which detects the nullptr private thread data and returns an invalid database instead.
141141
// QSqlDatabase::removeDatabase is thread safe, so this is ok to do.
142142
// Right about now is a good time to re-evaluate your selected career ;)
143-
connect( QThread::currentThread(), &QThread::finished, this, [connectionName, this ]
143+
connect( QThread::currentThread(), &QThread::finished, QThread::currentThread(), [connectionName, this ]
144144
{
145145
QMutexLocker locker( mMutex );
146146
QgsDebugMsgLevel( QStringLiteral( "Removing outdated connection to %1 on thread exit" ).arg( connectionName ), 2 );

‎src/providers/mssql/qgsmssqlconnection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ QSqlDatabase QgsMssqlConnection::getDatabase( const QString &service, const QStr
7373
// and a subsequent call to QSqlDatabase::database with the same thread address (yep it happens, actually a lot)
7474
// triggers a condition in QSqlDatabase which detects the nullptr private thread data and returns an invalid database instead.
7575
// QSqlDatabase::removeDatabase is thread safe, so this is ok to do.
76-
QObject::connect( QThread::currentThread(), &QThread::finished, QCoreApplication::instance(), [connectionName]
76+
QObject::connect( QThread::currentThread(), &QThread::finished, QThread::currentThread(), [connectionName]
7777
{
7878
QMutexLocker locker( &sMutex );
7979
QSqlDatabase::removeDatabase( connectionName );

0 commit comments

Comments
 (0)
Please sign in to comment.