Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
81dd7115
Kaydet (Commit)
81dd7115
authored
Mar 10, 2016
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Manage JavaInfo instances via new/delete
Change-Id: I10a113718e525b646c51aa8a19f9f2b75a36714a
üst
624f9696
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
21 deletions
+11
-21
framework.hxx
include/jvmfwk/framework.hxx
+2
-4
sunjavaplugin.cxx
jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+1
-3
elements.cxx
jvmfwk/source/elements.cxx
+1
-3
framework.cxx
jvmfwk/source/framework.cxx
+7
-11
No files found.
include/jvmfwk/framework.hxx
Dosyayı görüntüle @
81dd7115
...
@@ -206,10 +206,8 @@ typedef enum _javaFrameworkError
...
@@ -206,10 +206,8 @@ typedef enum _javaFrameworkError
<p>
<p>
Instances of this struct are created by the plug-in libraries which are used by
Instances of this struct are created by the plug-in libraries which are used by
this framework (jvmfwk/vendorplugin.h). The memory of the instances is created
this framework (jvmfwk/vendorplugin.h). The contained members must be
by <code>rtl_allocateMemory</code> (rtl/alloc.h). Therefore, the memory must
freed individually.
be freed by <code>rtl_freeMemory</code>. Also the contained members must be
freed particularly.
For convenience this API provides the function <code>jfw_freeJavaInfo</code>
For convenience this API provides the function <code>jfw_freeJavaInfo</code>
which frees the objects properly. </p>
which frees the objects properly. </p>
*/
*/
...
...
jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
Dosyayı görüntüle @
81dd7115
...
@@ -146,9 +146,7 @@ OString getPluginJarPath(
...
@@ -146,9 +146,7 @@ OString getPluginJarPath(
JavaInfo
*
createJavaInfo
(
const
rtl
::
Reference
<
VendorBase
>
&
info
)
JavaInfo
*
createJavaInfo
(
const
rtl
::
Reference
<
VendorBase
>
&
info
)
{
{
JavaInfo
*
pInfo
=
static_cast
<
JavaInfo
*>
(
rtl_allocateMemory
(
sizeof
(
JavaInfo
)));
JavaInfo
*
pInfo
=
new
JavaInfo
;
if
(
pInfo
==
nullptr
)
return
nullptr
;
OUString
sVendor
=
info
->
getVendor
();
OUString
sVendor
=
info
->
getVendor
();
pInfo
->
sVendor
=
sVendor
.
pData
;
pInfo
->
sVendor
=
sVendor
.
pData
;
rtl_uString_acquire
(
sVendor
.
pData
);
rtl_uString_acquire
(
sVendor
.
pData
);
...
...
jvmfwk/source/elements.cxx
Dosyayı görüntüle @
81dd7115
...
@@ -977,9 +977,7 @@ JavaInfo * CNodeJavaInfo::makeJavaInfo() const
...
@@ -977,9 +977,7 @@ JavaInfo * CNodeJavaInfo::makeJavaInfo() const
{
{
if
(
bNil
||
m_bEmptyNode
)
if
(
bNil
||
m_bEmptyNode
)
return
nullptr
;
return
nullptr
;
JavaInfo
*
pInfo
=
static_cast
<
JavaInfo
*>
(
rtl_allocateMemory
(
sizeof
(
JavaInfo
)));
JavaInfo
*
pInfo
=
new
JavaInfo
;
if
(
pInfo
==
nullptr
)
return
nullptr
;
memset
(
pInfo
,
0
,
sizeof
(
JavaInfo
));
memset
(
pInfo
,
0
,
sizeof
(
JavaInfo
));
pInfo
->
sVendor
=
sVendor
.
pData
;
pInfo
->
sVendor
=
sVendor
.
pData
;
rtl_uString_acquire
(
pInfo
->
sVendor
);
rtl_uString_acquire
(
pInfo
->
sVendor
);
...
...
jvmfwk/source/framework.cxx
Dosyayı görüntüle @
81dd7115
...
@@ -655,7 +655,7 @@ void jfw_freeJavaInfo(JavaInfo *pInfo)
...
@@ -655,7 +655,7 @@ void jfw_freeJavaInfo(JavaInfo *pInfo)
rtl_uString_release
(
pInfo
->
sLocation
);
rtl_uString_release
(
pInfo
->
sLocation
);
rtl_uString_release
(
pInfo
->
sVersion
);
rtl_uString_release
(
pInfo
->
sVersion
);
rtl_byte_sequence_release
(
pInfo
->
arVendorData
);
rtl_byte_sequence_release
(
pInfo
->
arVendorData
);
rtl_freeMemory
(
pInfo
)
;
delete
pInfo
;
}
}
javaFrameworkError
jfw_getSelectedJRE
(
JavaInfo
**
ppInfo
)
javaFrameworkError
jfw_getSelectedJRE
(
JavaInfo
**
ppInfo
)
...
@@ -1081,16 +1081,12 @@ JavaInfo * CJavaInfo::copyJavaInfo(const JavaInfo * pInfo)
...
@@ -1081,16 +1081,12 @@ JavaInfo * CJavaInfo::copyJavaInfo(const JavaInfo * pInfo)
{
{
if
(
pInfo
==
nullptr
)
if
(
pInfo
==
nullptr
)
return
nullptr
;
return
nullptr
;
JavaInfo
*
newInfo
=
JavaInfo
*
newInfo
=
new
JavaInfo
;
static_cast
<
JavaInfo
*>
(
rtl_allocateMemory
(
sizeof
(
JavaInfo
)));
memcpy
(
newInfo
,
pInfo
,
sizeof
(
JavaInfo
));
if
(
newInfo
)
rtl_uString_acquire
(
pInfo
->
sVendor
);
{
rtl_uString_acquire
(
pInfo
->
sLocation
);
memcpy
(
newInfo
,
pInfo
,
sizeof
(
JavaInfo
));
rtl_uString_acquire
(
pInfo
->
sVersion
);
rtl_uString_acquire
(
pInfo
->
sVendor
);
rtl_byte_sequence_acquire
(
pInfo
->
arVendorData
);
rtl_uString_acquire
(
pInfo
->
sLocation
);
rtl_uString_acquire
(
pInfo
->
sVersion
);
rtl_byte_sequence_acquire
(
pInfo
->
arVendorData
);
}
return
newInfo
;
return
newInfo
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment