From dbd400b93726c1922cb9f1d9e74732b679d57586 Mon Sep 17 00:00:00 2001 From: Dyami Caliri Date: Fri, 19 Sep 2014 20:57:51 -0700 Subject: 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 --- src/corelib/global/qlibraryinfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 settings(QLibraryInfoPrivate::findConfiguration()); + if (!settings.isNull()) { QString key = QLatin1String(platformsSection); key += QLatin1Char('/'); key += platformName; -- cgit v1.2.3