Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 31, 2017
1 parent 75c65c5 commit e84543d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsuserprofilemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void QgsUserProfileManager::setRootLocation( QString rootProfileLocation )
{
mWatcher->addPath( mRootProfilePath );
}
mSettings = new QSettings( settingsFile(), QSettings::IniFormat );
mSettings.reset( new QSettings( settingsFile(), QSettings::IniFormat ) );
}

bool QgsUserProfileManager::rootLocationIsSet() const
Expand Down Expand Up @@ -172,7 +172,7 @@ QgsError QgsUserProfileManager::deleteProfile( const QString name )
return error;
}

QString QgsUserProfileManager::settingsFile()
QString QgsUserProfileManager::settingsFile() const
{
return mRootProfilePath + QDir::separator() + "profiles.ini";
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsuserprofilemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ class CORE_EXPORT QgsUserProfileManager : public QObject

std::unique_ptr<QgsUserProfile> mUserProfile;

QString settingsFile();
QString settingsFile() const;

QSettings *mSettings = nullptr;
std::unique_ptr< QSettings > mSettings;
};

#endif // QGSUSERPROFILEMANAGER_H

0 comments on commit e84543d

Please sign in to comment.