summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-03-10 19:21:15 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-03-10 21:42:31 +0100
commit8e9a7cac42d554402a6ead3a83ae8b7defc9247b (patch)
tree9905516c3e7ca3cc6de020e8cc36d84adb650a29 /jvmfwk
parent8546831b3b36e29c1ee42b790cbecd3fd8d8bbaf (diff)
No more need for jfw_freeJavaInfo
Change-Id: I2426a76936b4099a243ce8c102da867e7868aac3
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/inc/vendorplugin.hxx7
-rw-r--r--jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx2
-rw-r--r--jvmfwk/source/framework.cxx22
3 files changed, 12 insertions, 19 deletions
diff --git a/jvmfwk/inc/vendorplugin.hxx b/jvmfwk/inc/vendorplugin.hxx
index a108cb3c5b4a..0bd5988301d6 100644
--- a/jvmfwk/inc/vendorplugin.hxx
+++ b/jvmfwk/inc/vendorplugin.hxx
@@ -73,8 +73,8 @@ typedef enum
version should be the first in the array. </p>
<p>
The function allocates memory for an array and all the JavaInfo objects returned
- in <code>parJavaInfo</code>. The caller must free each JavaInfo object by calling
- <code>jfw_freeJavaInfo</code> (#include "jvmfwk/framework.hxx"). The array is to be
+ in <code>parJavaInfo</code>. The caller must delete each JavaInfo object.
+ The array is to be
freed by rtl_freeMemory.
In case an error occurred <code>parJavaInfo</code> need not be freed.
</p>
@@ -217,8 +217,7 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
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 free each JavaInfo object by calling
- <code>jfw_freeJavaInfo</code> (#include "jvmfwk/framework.hxx").
+ 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.
diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
index 748b7d7d45d4..ea2f846e9f25 100644
--- a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
+++ b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
@@ -97,7 +97,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
OString sPaths = getLD_LIBRARY_PATH(pInfo->arVendorData);
fprintf(stdout, "%s\n", sPaths.getStr());
- jfw_freeJavaInfo(pInfo);
+ delete pInfo;
}
catch (const std::exception&)
{
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 6f9c45584d94..88658a18175f 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -427,7 +427,7 @@ javaFrameworkError jfw_findAndSelectJRE(JavaInfo **pInfo)
{
bInfoFound = true;
}
- jfw_freeJavaInfo(pHomeInfo);
+ delete pHomeInfo;
}
// if no Java installation providing all features was detected by using JAVA_HOME,
@@ -460,7 +460,7 @@ javaFrameworkError jfw_findAndSelectJRE(JavaInfo **pInfo)
aCurrentInfo = pJInfo;
}
- jfw_freeJavaInfo(pJInfo);
+ delete pJInfo;
}
++it;
}
@@ -529,7 +529,7 @@ javaFrameworkError jfw_findAndSelectJRE(JavaInfo **pInfo)
//The array returned by jfw_plugin_getAllJavaInfos must be freed as well as
//its contents
for (int j = 0; j < cInfos; j++)
- jfw_freeJavaInfo(arInfos[j]);
+ delete arInfos[j];
rtl_freeMemory(arInfos);
if (bInfoFound)
@@ -642,12 +642,6 @@ bool jfw_areEqualJavaInfo(JavaInfo const * pInfoA,JavaInfo const * pInfoB)
return false;
}
-
-void jfw_freeJavaInfo(JavaInfo *pInfo)
-{
- delete pInfo;
-}
-
javaFrameworkError jfw_getSelectedJRE(JavaInfo **ppInfo)
{
javaFrameworkError errcode = JFW_E_NONE;
@@ -805,7 +799,7 @@ javaFrameworkError jfw_setSelectedJRE(JavaInfo const *pInfo)
jfw::setJavaSelected();
}
- jfw_freeJavaInfo(currentInfo);
+ delete currentInfo;
}
catch (const jfw::FrameworkException& e)
{
@@ -1051,7 +1045,7 @@ CJavaInfo CJavaInfo::createWrapper(::JavaInfo* info)
}
void CJavaInfo::attach(::JavaInfo * info)
{
- jfw_freeJavaInfo(pInfo);
+ delete pInfo;
pInfo = info;
}
::JavaInfo * CJavaInfo::detach()
@@ -1063,7 +1057,7 @@ void CJavaInfo::attach(::JavaInfo * info)
CJavaInfo::~CJavaInfo()
{
- jfw_freeJavaInfo(pInfo);
+ delete pInfo;
}
@@ -1085,7 +1079,7 @@ CJavaInfo & CJavaInfo::operator = (const CJavaInfo& info)
if (&info == this)
return *this;
- jfw_freeJavaInfo(pInfo);
+ delete pInfo;
pInfo = copyJavaInfo(info.pInfo);
return *this;
}
@@ -1094,7 +1088,7 @@ CJavaInfo & CJavaInfo::operator = (const ::JavaInfo* info)
if (info == pInfo)
return *this;
- jfw_freeJavaInfo(pInfo);
+ delete pInfo;
pInfo = copyJavaInfo(info);
return *this;
}