From 74315cbccf13b578551390762d5efc0a30c2d65b Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 13 Apr 2017 15:25:28 +0200 Subject: Use std::unique_ptr in jfw_plugin_getJavaInfoFromJavaHome Change-Id: I8be48d1eec799f347a5edaa67837cf1bbf4d2cc3 --- jvmfwk/source/framework.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'jvmfwk/source') 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 *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, -- cgit