Skip to content

Commit

Permalink
suppress warning
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jul 10, 2024
1 parent a30666d commit 017ccbd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ The URI should be in the format: \verbatim<DRIVER>://<USER>:<PASSWORD>@<HOST>:<P
%End


~QgsAuthConfigurationStorageDb();


QSqlDatabase authDatabaseConnection() const;
%Docstring
Returns the database connection used by this storage.
Expand Down
14 changes: 13 additions & 1 deletion src/core/auth/qgsauthconfigurationstoragedb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ QgsAuthConfigurationStorageDb::QgsAuthConfigurationStorageDb( const QString &uri
{
}

QgsAuthConfigurationStorageDb::~QgsAuthConfigurationStorageDb()
{
QMutexLocker locker( &mMutex );

QMapIterator<QThread *, QMetaObject::Connection> iterator( mConnectedThreads );
while ( iterator.hasNext() )
{
iterator.next();
QThread::disconnect( iterator.value() );
}
}

QSqlDatabase QgsAuthConfigurationStorageDb::authDatabaseConnection() const
{
QSqlDatabase authdb;
Expand Down Expand Up @@ -100,7 +112,7 @@ QSqlDatabase QgsAuthConfigurationStorageDb::authDatabaseConnection() const
{
QMutexLocker locker( &mMutex );
QSqlDatabase::removeDatabase( connectionName );
mConnectedThreads.remove( QThread::currentThread() );
mConnectedThreads.remove( QThread::currentThread() ); // NOLINT(clang-analyzer-core.CallAndMessage)
}, Qt::DirectConnection );

mConnectedThreads.insert( QThread::currentThread(), connection );
Expand Down
3 changes: 3 additions & 0 deletions src/core/auth/qgsauthconfigurationstoragedb.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ class CORE_EXPORT QgsAuthConfigurationStorageDb : public QgsAuthConfigurationSto
QgsAuthConfigurationStorageDb( const QString &uri );


~QgsAuthConfigurationStorageDb() override;


/**
* Returns the database connection used by this storage.
*/
Expand Down

0 comments on commit 017ccbd

Please sign in to comment.