diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-02-20 15:46:28 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-02-20 16:20:04 +0100 |
commit | ca7ecd87e8cd84babc04442e579086934181f2f5 (patch) | |
tree | ce20dc36e78176ee0467c463b36220f4940abc96 /src/lib/qtprofilesetup/qtprofilesetup.cpp | |
parent | 279802c06a4d22b2597415e756ff5381a37c3e7e (diff) |
Fix exception leak in qtprofilesetup.
This is public API and must not throw.
Change-Id: I211956ed6667bf3bae1e0049f2eb29516f55ef6a
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/lib/qtprofilesetup/qtprofilesetup.cpp')
-rw-r--r-- | src/lib/qtprofilesetup/qtprofilesetup.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/qtprofilesetup/qtprofilesetup.cpp b/src/lib/qtprofilesetup/qtprofilesetup.cpp index 5278bfc9f..2c5547308 100644 --- a/src/lib/qtprofilesetup/qtprofilesetup.cpp +++ b/src/lib/qtprofilesetup/qtprofilesetup.cpp @@ -359,8 +359,8 @@ static bool checkForStaticBuild(const QtEnvironment &qt) return true; } -ErrorInfo setupQtProfile(const QString &profileName, Settings *settings, - const QtEnvironment &_qtEnvironment) +void doSetupQtProfile(const QString &profileName, Settings *settings, + const QtEnvironment &_qtEnvironment) { QtEnvironment qtEnvironment = _qtEnvironment; const bool staticBuild = checkForStaticBuild(qtEnvironment); @@ -422,8 +422,8 @@ ErrorInfo setupQtProfile(const QString &profileName, Settings *settings, } if (osxVersion.isEmpty()) { - return ErrorInfo(Internal::Tr::tr("Error reading qconfig.h; could not determine " - "whether Qt is using Cocoa or Carbon")); + throw ErrorInfo(Internal::Tr::tr("Error reading qconfig.h; could not determine " + "whether Qt is using Cocoa or Carbon")); } } @@ -455,12 +455,18 @@ ErrorInfo setupQtProfile(const QString &profileName, Settings *settings, if (!androidVersion.isEmpty()) profile.setValue(QLatin1String("cpp.minimumAndroidVersion"), androidVersion); + createModules(profile, settings, qtEnvironment); +} + +ErrorInfo setupQtProfile(const QString &profileName, Settings *settings, + const QtEnvironment &qtEnvironment) +{ try { - createModules(profile, settings, qtEnvironment); + doSetupQtProfile(profileName, settings, qtEnvironment); + return ErrorInfo(); } catch (const ErrorInfo &e) { return e; } - return ErrorInfo(); } } // namespace qbs |