diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-04-13 15:25:28 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-13 17:32:43 +0200 |
commit | 74315cbccf13b578551390762d5efc0a30c2d65b (patch) | |
tree | 68c4390e825b8eb6225825514a7b13af579ee215 /jvmfwk/source | |
parent | 626dec44e33727a56353efb7f4eee83e93bc2f3d (diff) |
Use std::unique_ptr<JavaInfo> in jfw_plugin_getJavaInfoFromJavaHome
Change-Id: I8be48d1eec799f347a5edaa67837cf1bbf4d2cc3
Diffstat (limited to 'jvmfwk/source')
-rw-r--r-- | jvmfwk/source/framework.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index 0dd643d92d45..87f4d3adce2b 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -364,20 +364,17 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo) // first inspect Java installation that the JAVA_HOME // environment variable points to (if it is set) - JavaInfo* pHomeInfo = nullptr; - if (jfw_plugin_getJavaInfoFromJavaHome(versionInfos, &pHomeInfo, infos) + if (jfw_plugin_getJavaInfoFromJavaHome( + versionInfos, &aCurrentInfo, infos) == javaPluginError::NONE) { - aCurrentInfo.reset(pHomeInfo); - // compare features // if the user does not require any features (nFeatureFlags = 0) // or the Java installation provides all features, then this installation is used - if ((pHomeInfo->nFeatures & nFeatureFlags) == nFeatureFlags) + if ((aCurrentInfo->nFeatures & nFeatureFlags) == nFeatureFlags) { bInfoFound = true; } - delete pHomeInfo; } // if no Java installation providing all features was detected by using JAVA_HOME, |