Kaydet (Commit) 8e9a7cac authored tarafından Stephan Bergmann's avatar Stephan Bergmann

No more need for jfw_freeJavaInfo

Change-Id: I2426a76936b4099a243ce8c102da867e7868aac3
üst 8546831b
......@@ -214,7 +214,7 @@ void SvxJavaOptionsPage::dispose()
for ( pIter = m_aAddedInfos.begin(); pIter != m_aAddedInfos.end(); ++pIter )
{
JavaInfo* pInfo = *pIter;
jfw_freeJavaInfo( pInfo );
delete pInfo;
}
m_aAddedInfos.clear();
......@@ -442,7 +442,7 @@ void SvxJavaOptionsPage::ClearJavaInfo()
for ( sal_Int32 i = 0; i < m_nInfoSize; ++i )
{
JavaInfo* pInfo = *parInfo++;
jfw_freeJavaInfo( pInfo );
delete pInfo;
}
rtl_freeMemory( m_parJavaInfo );
......@@ -508,7 +508,7 @@ void SvxJavaOptionsPage::LoadJREs()
}
}
jfw_freeJavaInfo( pSelectedJava );
delete pSelectedJava;
#else
(void) this;
#endif
......@@ -602,7 +602,7 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
nPos = m_pJavaList->GetEntryCount() - 1;
}
else
jfw_freeJavaInfo( pInfo );
delete pInfo;
SvTreeListEntry* pEntry = m_pJavaList->GetEntry( nPos );
m_pJavaList->Select( pEntry );
......@@ -722,7 +722,7 @@ bool SvxJavaOptionsPage::FillItemSet( SfxItemSet* /*rCoreSet*/ )
bModified = true;
}
}
jfw_freeJavaInfo( pSelectedJava );
delete pSelectedJava;
break;
}
}
......
......@@ -73,7 +73,7 @@ CJavaInfo::CJavaInfo(): pData(nullptr)
CJavaInfo::~CJavaInfo()
{
jfw_freeJavaInfo(pData);
delete pData;
}
......
......@@ -208,9 +208,7 @@ typedef enum _javaFrameworkError
<p>
Instances of this struct are created by the plug-in libraries which are used by
this framework (jvmfwk/vendorplugin.h).
For convenience this API provides the function <code>jfw_freeJavaInfo</code>
which frees the objects properly. </p>
this framework (jvmfwk/vendorplugin.h).</p>
*/
struct JavaInfo
{
......@@ -257,13 +255,6 @@ struct JavaInfo
rtl::ByteSequence arVendorData;
};
/** frees the memory of a <code>JavaInfo</code> object.
@param pInfo
The object which is to be freed. It can be NULL;
*/
JVMFWK_DLLPUBLIC void jfw_freeJavaInfo(JavaInfo *pInfo);
/** compares two <code>JavaInfo</code> objects for equality.
<p>Two <code>JavaInfo</code> objects are said to be equal if the contained
......@@ -362,7 +353,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError jfw_isVMRunning(sal_Bool *bRunning);
@param ppInfo
[out] a <code>JavaInfo</code> pointer, representing the selected JRE.
The caller has to free it by calling <code>jfw_freeJavaInfo<code>. The
The caller has to delete it. The
<code>JavaInfo</code> is for informational purposes only. It is not
necessary to call <code>jfw_setSelectedJRE</code> afterwards.<br/>
<code>ppInfo</code>can be NULL. If <code>*ppInfo</code> is not null, then it is
......@@ -393,7 +384,7 @@ JVMFWK_DLLPUBLIC javaFrameworkError jfw_findAndSelectJRE(JavaInfo **pInfo);
[out] on returns it contains a pointer to an array of <code>JavaInfo</code>
pointers.
The caller must free the array with <code>rtl_freeMemory</code> and each
element of the array must be freed with <code>jfw_freeJavaInfo</code>.
element of the array must be deleted.
@param pSize
[out] on return contains the size of array returned in <code>parInfo</code>.
......@@ -750,8 +741,8 @@ JVMFWK_DLLPUBLIC javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, sal_Bool
should be called. That is, <code>jfw_startVM</code> which uses the
settings cannot be called before all settings have be made.</p>
<p>
The only functions which are not effected by <code>jfw_lock</code> are
<code>jfw_freeJavaInfo</code> and <code>jfw_areEqualJavaInfo</code>.
The only functions which is not effected by <code>jfw_lock</code> is
<code>jfw_areEqualJavaInfo</code>.
*/
JVMFWK_DLLPUBLIC void jfw_lock();
......
......@@ -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.
......
......@@ -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&)
{
......
......@@ -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;
}
......
......@@ -662,10 +662,10 @@ namespace {
struct JavaInfoGuard: private boost::noncopyable {
JavaInfoGuard(): info(nullptr) {}
~JavaInfoGuard() { jfw_freeJavaInfo(info); }
~JavaInfoGuard() { delete info; }
void clear() {
jfw_freeJavaInfo(info);
delete info;
info = nullptr;
}
......@@ -836,7 +836,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
}
}
jfw_freeJavaInfo(pJavaInfo);
delete pJavaInfo;
//Error: %PRODUCTNAME requires a Java
//runtime environment (JRE) to perform this task. The selected JRE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment