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
0d312afe
Kaydet (Commit)
0d312afe
authored
Tem 21, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#1312087 Resource leak
Change-Id: I6d526440bd652dcd1745b8d84ff69855691d7e48
üst
289e5dbb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
26 deletions
+27
-26
fileview.cxx
svtools/source/contnr/fileview.cxx
+23
-23
foldertree.cxx
svtools/source/contnr/foldertree.cxx
+4
-3
No files found.
svtools/source/contnr/fileview.cxx
Dosyayı görüntüle @
0d312afe
...
...
@@ -421,10 +421,10 @@ protected:
Link
<>
m_aSelectHandler
;
::
rtl
::
Reference
<
::
svt
::
FileViewContentEnumerator
>
m_
p
ContentEnumerator
;
m_
x
ContentEnumerator
;
Link
<>
m_aCurrentAsyncActionHandler
;
::
osl
::
Condition
m_aAsyncActionFinished
;
::
rtl
::
Reference
<
::
salhelper
::
Timer
>
m_
p
CancelAsyncTimer
;
::
rtl
::
Reference
<
::
salhelper
::
Timer
>
m_
x
CancelAsyncTimer
;
::
svt
::
EnumerationResult
m_eAsyncActionResult
;
bool
m_bRunningAsyncAction
;
bool
m_bAsyncActionCancelled
;
...
...
@@ -1639,21 +1639,21 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
DBG_TESTSOLARMUTEX
();
::
osl
::
ClearableMutexGuard
aGuard
(
maMutex
);
OSL_ENSURE
(
!
m_
p
ContentEnumerator
.
is
(),
"SvtFileView_Impl::GetFolderContent_Impl: still running another enumeration!"
);
m_
pContentEnumerator
=
new
::
svt
::
FileViewContentEnumerator
(
mpView
->
GetCommandEnvironment
(),
maContent
,
maMutex
,
mbReplaceNames
?
mpNameTrans
:
NULL
);
OSL_ENSURE
(
!
m_
x
ContentEnumerator
.
is
(),
"SvtFileView_Impl::GetFolderContent_Impl: still running another enumeration!"
);
m_
xContentEnumerator
.
set
(
new
::
svt
::
FileViewContentEnumerator
(
mpView
->
GetCommandEnvironment
(),
maContent
,
maMutex
,
mbReplaceNames
?
mpNameTrans
:
NULL
)
);
// TODO: should we cache and re-use this thread?
if
(
!
pAsyncDescriptor
)
{
::
svt
::
EnumerationResult
eResult
=
m_
p
ContentEnumerator
->
enumerateFolderContentSync
(
_rFolder
,
rBlackList
);
::
svt
::
EnumerationResult
eResult
=
m_
x
ContentEnumerator
->
enumerateFolderContentSync
(
_rFolder
,
rBlackList
);
if
(
::
svt
::
SUCCESS
==
eResult
)
{
implEnumerationSuccess
();
m_
p
ContentEnumerator
.
clear
();
m_
x
ContentEnumerator
.
clear
();
return
eSuccess
;
}
m_
p
ContentEnumerator
.
clear
();
m_
x
ContentEnumerator
.
clear
();
return
eFailure
;
}
...
...
@@ -1676,7 +1676,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
pTimeout
->
Seconds
=
nMinTimeout
/
1000L
;
pTimeout
->
Nanosec
=
(
nMinTimeout
%
1000L
)
*
1000000L
;
m_
p
ContentEnumerator
->
enumerateFolderContent
(
_rFolder
,
this
);
m_
x
ContentEnumerator
->
enumerateFolderContent
(
_rFolder
,
this
);
// wait until the enumeration is finished
// for this, release our own mutex (which is used by the enumerator thread)
...
...
@@ -1697,16 +1697,16 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
if
(
::
osl
::
Condition
::
result_timeout
==
eResult
)
{
// maximum time to wait
OSL_ENSURE
(
!
m_
p
CancelAsyncTimer
.
get
(),
"SvtFileView_Impl::GetFolderContent_Impl: there's still a previous timer!"
);
m_
pCancelAsyncTimer
=
new
CallbackTimer
(
this
);
OSL_ENSURE
(
!
m_
x
CancelAsyncTimer
.
get
(),
"SvtFileView_Impl::GetFolderContent_Impl: there's still a previous timer!"
);
m_
xCancelAsyncTimer
.
set
(
new
CallbackTimer
(
this
)
);
sal_Int32
nMaxTimeout
=
pAsyncDescriptor
->
nMaxTimeout
;
OSL_ENSURE
(
nMaxTimeout
>
nMinTimeout
,
"SvtFileView_Impl::GetFolderContent_Impl: invalid maximum timeout!"
);
if
(
nMaxTimeout
<=
nMinTimeout
)
nMaxTimeout
=
nMinTimeout
+
5000
;
m_
p
CancelAsyncTimer
->
setRemainingTime
(
salhelper
::
TTimeValue
(
nMaxTimeout
-
nMinTimeout
)
);
m_
x
CancelAsyncTimer
->
setRemainingTime
(
salhelper
::
TTimeValue
(
nMaxTimeout
-
nMinTimeout
)
);
// we already waited for nMinTimeout milliseconds, so take this into account
m_
p
CancelAsyncTimer
->
start
();
m_
x
CancelAsyncTimer
->
start
();
m_aCurrentAsyncActionHandler
=
pAsyncDescriptor
->
aFinishHandler
;
DBG_ASSERT
(
m_aCurrentAsyncActionHandler
.
IsSet
(),
"SvtFileView_Impl::GetFolderContent_Impl: nobody interested when it's finished?"
);
...
...
@@ -1897,17 +1897,17 @@ void SvtFileView_Impl::CancelRunningAsyncAction()
{
DBG_TESTSOLARMUTEX
();
::
osl
::
MutexGuard
aGuard
(
maMutex
);
if
(
!
m_
p
ContentEnumerator
.
is
()
)
if
(
!
m_
x
ContentEnumerator
.
is
()
)
return
;
m_bAsyncActionCancelled
=
true
;
m_
p
ContentEnumerator
->
cancel
();
m_
x
ContentEnumerator
->
cancel
();
m_bRunningAsyncAction
=
false
;
m_
p
ContentEnumerator
.
clear
();
if
(
m_
pCancelAsyncTimer
.
is
()
&&
m_p
CancelAsyncTimer
->
isTicking
()
)
m_
p
CancelAsyncTimer
->
stop
();
m_
pCancelAsyncTimer
=
NULL
;
m_
x
ContentEnumerator
.
clear
();
if
(
m_
xCancelAsyncTimer
.
is
()
&&
m_x
CancelAsyncTimer
->
isTicking
()
)
m_
x
CancelAsyncTimer
->
stop
();
m_
xCancelAsyncTimer
.
clear
()
;
}
...
...
@@ -1934,10 +1934,10 @@ void SvtFileView_Impl::enumerationDone( ::svt::EnumerationResult eResult )
SolarMutexGuard
aSolarGuard
;
::
osl
::
MutexGuard
aGuard
(
maMutex
);
m_
p
ContentEnumerator
.
clear
();
if
(
m_
pCancelAsyncTimer
.
is
()
&&
m_p
CancelAsyncTimer
->
isTicking
()
)
m_
p
CancelAsyncTimer
->
stop
();
m_
pCancelAsyncTimer
=
NULL
;
m_
x
ContentEnumerator
.
clear
();
if
(
m_
xCancelAsyncTimer
.
is
()
&&
m_x
CancelAsyncTimer
->
isTicking
()
)
m_
x
CancelAsyncTimer
->
stop
();
m_
xCancelAsyncTimer
.
clear
()
;
if
(
m_bAsyncActionCancelled
)
// this is to prevent race conditions
...
...
svtools/source/contnr/foldertree.cxx
Dosyayı görüntüle @
0d312afe
...
...
@@ -36,8 +36,9 @@ void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry )
{
::
std
::
vector
<
SortingData_Impl
*
>
aContent
;
FileViewContentEnumerator
*
pContentEnumerator
=
new
FileViewContentEnumerator
(
m_xEnv
,
aContent
,
m_aMutex
,
NULL
);
::
rtl
::
Reference
<
::
svt
::
FileViewContentEnumerator
>
xContentEnumerator
(
new
FileViewContentEnumerator
(
m_xEnv
,
aContent
,
m_aMutex
,
NULL
));
OUString
*
pURL
=
static_cast
<
OUString
*
>
(
pEntry
->
GetUserData
()
);
...
...
@@ -46,7 +47,7 @@ void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry )
FolderDescriptor
aFolder
(
*
pURL
);
EnumerationResult
eResult
=
p
ContentEnumerator
->
enumerateFolderContentSync
(
aFolder
,
m_aBlackList
);
x
ContentEnumerator
->
enumerateFolderContentSync
(
aFolder
,
m_aBlackList
);
if
(
SUCCESS
==
eResult
)
{
...
...
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