Skip to content

Commit 774c890

Browse files
authoredDec 4, 2018
Merge pull request #8599 from m-kuhn/auth-manager-unique-ptr
Use std::unique_ptr
2 parents c39e2b8 + f616450 commit 774c890

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed
 

‎src/core/auth/qgsauthmanager.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ bool QgsAuthManager::init( const QString &pluginPath, const QString &authDatabas
175175
mAuthInit = true;
176176

177177
QgsDebugMsg( QStringLiteral( "Initializing QCA..." ) );
178-
mQcaInitializer = new QCA::Initializer( QCA::Practical, 256 );
178+
mQcaInitializer = qgis::make_unique<QCA::Initializer>( QCA::Practical, 256 );
179179

180180
QgsDebugMsg( QStringLiteral( "QCA initialized." ) );
181181
QCA::scanForPlugins();
@@ -2974,8 +2974,6 @@ QgsAuthManager::~QgsAuthManager()
29742974
mMutex = nullptr;
29752975
delete mScheduledDbEraseTimer;
29762976
mScheduledDbEraseTimer = nullptr;
2977-
delete mQcaInitializer;
2978-
mQcaInitializer = nullptr;
29792977
QSqlDatabase::removeDatabase( QStringLiteral( "authentication.configs" ) );
29802978
}
29812979

‎src/core/auth/qgsauthmanager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
848848
bool mAuthInit = false;
849849
QString mAuthDbPath;
850850

851-
QCA::Initializer *mQcaInitializer = nullptr;
851+
std::unique_ptr<QCA::Initializer> mQcaInitializer;
852852

853853
QHash<QString, QString> mConfigAuthMethods;
854854
QHash<QString, QgsAuthMethod *> mAuthMethods;

0 commit comments

Comments
 (0)
Please sign in to comment.