diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-04-13 15:19:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-13 17:32:43 +0200 |
commit | 626dec44e33727a56353efb7f4eee83e93bc2f3d (patch) | |
tree | 629bb290fee1689d1484d7c430b475da7082994e /jvmfwk/inc | |
parent | 6925007c2a86d45a8d71f08ef46e56bb3eda21e3 (diff) |
Use std::unique_ptr<JavaInfo> in jfw_plugin_getJavaInfosFromPath
...thereby fixing a memory leak
Change-Id: I1aa91eeb407987abcdaa5221f4abd447f881c5d2
Diffstat (limited to 'jvmfwk/inc')
-rw-r--r-- | jvmfwk/inc/vendorplugin.hxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/jvmfwk/inc/vendorplugin.hxx b/jvmfwk/inc/vendorplugin.hxx index d456fe74a59c..875185551688 100644 --- a/jvmfwk/inc/vendorplugin.hxx +++ b/jvmfwk/inc/vendorplugin.hxx @@ -25,6 +25,8 @@ #include <rtl/ref.hxx> #include <rtl/ustring.h> #include "jni.h" + +#include <memory> #include <vector> #include <utility> #include "elements.hxx" @@ -204,10 +206,6 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome( The JavaInfo structures returned in <code>vecJavaInfosFromPath</code> should be ordered according to their occurrence in the PATH. The one that is the first one on the PATH is also the first element in the vector.</p> - <p> - The function allocates memory for all the JavaInfo objects returned - in <code>vecJavaInfosFromPath</code>. The caller must delete each JavaInfo object. - </p> @param vecVendorInfos [in] vector specifying the vendor and version requirements that the JRE must fulfill. The vector contains pairs of vendors and the respective version requirements @@ -230,7 +228,7 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome( javaPluginError jfw_plugin_getJavaInfosFromPath( std::vector<std::pair<OUString, jfw::VersionInfo>> const& vecVendorInfos, - std::vector<JavaInfo*> & vecJavaInfosFromPath, + std::vector<std::unique_ptr<JavaInfo>> & vecJavaInfosFromPath, std::vector<rtl::Reference<jfw_plugin::VendorBase>> & infos); /** starts a Java Virtual Machine. |