diff options
author | Dyami Caliri <dyami@dragonframe.com> | 2014-09-19 20:57:51 -0700 |
---|---|---|
committer | Dyami Caliri <dyami@dragonframe.com> | 2014-09-20 16:42:08 +0200 |
commit | dbd400b93726c1922cb9f1d9e74732b679d57586 (patch) | |
tree | 431c094529096f2da1234711835193239647b1b1 /src/corelib/global/qlibraryinfo.cpp | |
parent | e98b5cddeb09e24373371af190dfcd92c9292aaf (diff) |
Fix memory leak of QSettings in QLibraryInfo::platformPluginArguments
The code calls QLibraryInfoPrivate::findConfiguration() to get a
new QSettings object but was not deleting it.
Change-Id: I207a7ff55f87aff91e2898a99e9cac06d57c5f7d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/corelib/global/qlibraryinfo.cpp')
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index f2ebeb6a03..c3c3048d01 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -567,7 +567,8 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) { #if !defined(QT_BOOTSTRAPPED) && !defined(QT_NO_SETTINGS) - if (const QSettings *settings = QLibraryInfoPrivate::findConfiguration()) { + QScopedPointer<const QSettings> settings(QLibraryInfoPrivate::findConfiguration()); + if (!settings.isNull()) { QString key = QLatin1String(platformsSection); key += QLatin1Char('/'); key += platformName; |