Skip to content

Commit

Permalink
Use std::unique_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Dec 4, 2018
1 parent cafa652 commit f616450
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/core/auth/qgsauthmanager.cpp
Expand Up @@ -175,7 +175,7 @@ bool QgsAuthManager::init( const QString &pluginPath, const QString &authDatabas
mAuthInit = true;

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

QgsDebugMsg( QStringLiteral( "QCA initialized." ) );
QCA::scanForPlugins();
Expand Down Expand Up @@ -2974,8 +2974,6 @@ QgsAuthManager::~QgsAuthManager()
mMutex = nullptr;
delete mScheduledDbEraseTimer;
mScheduledDbEraseTimer = nullptr;
delete mQcaInitializer;
mQcaInitializer = nullptr;
QSqlDatabase::removeDatabase( QStringLiteral( "authentication.configs" ) );
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/auth/qgsauthmanager.h
Expand Up @@ -848,7 +848,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
bool mAuthInit = false;
QString mAuthDbPath;

QCA::Initializer *mQcaInitializer = nullptr;
std::unique_ptr<QCA::Initializer> mQcaInitializer;

QHash<QString, QString> mConfigAuthMethods;
QHash<QString, QgsAuthMethod *> mAuthMethods;
Expand Down

0 comments on commit f616450

Please sign in to comment.