summaryrefslogtreecommitdiff
path: root/chart2/source/tools/LifeTime.cxx
diff options
context:
space:
mode:
authorIngrid Halama <iha@openoffice.org>2010-05-10 18:46:46 +0200
committerIngrid Halama <iha@openoffice.org>2010-05-10 18:46:46 +0200
commitacc8dc48697b824297870017239630c1d4f17f12 (patch)
treed5019e76d231a6815089d64795d214565e1b907b /chart2/source/tools/LifeTime.cxx
parent6d0afcd0db46ad125c243b8854b78da250b5f581 (diff)
chart47: #i109770# #i110253# reduce assertions 'already disposed or closed'
Diffstat (limited to 'chart2/source/tools/LifeTime.cxx')
-rw-r--r--chart2/source/tools/LifeTime.cxx22
1 files changed, 15 insertions, 7 deletions
diff --git a/chart2/source/tools/LifeTime.cxx b/chart2/source/tools/LifeTime.cxx
index 68ed06208d11..bbc2924e0b56 100644
--- a/chart2/source/tools/LifeTime.cxx
+++ b/chart2/source/tools/LifeTime.cxx
@@ -62,12 +62,15 @@ LifeTimeManager::~LifeTimeManager()
{
}
- sal_Bool LifeTimeManager
-::impl_isDisposed()
+bool LifeTimeManager::impl_isDisposed( bool bAssert )
{
if( m_bDisposed || m_bInDispose )
{
- OSL_ENSURE( sal_False, "This component is already disposed " );
+ if( bAssert )
+ {
+ OSL_ENSURE( sal_False, "This component is already disposed " );
+ (void)(bAssert);
+ }
return sal_True;
}
return sal_False;
@@ -185,15 +188,18 @@ CloseableLifeTimeManager::~CloseableLifeTimeManager()
{
}
- sal_Bool CloseableLifeTimeManager
-::impl_isDisposedOrClosed()
+bool CloseableLifeTimeManager::impl_isDisposedOrClosed( bool bAssert )
{
- if( impl_isDisposed() )
+ if( impl_isDisposed( bAssert ) )
return sal_True;
if( m_bClosed )
{
- OSL_ENSURE( sal_False, "This object is already closed" );
+ if( bAssert )
+ {
+ OSL_ENSURE( sal_False, "This object is already closed" );
+ (void)(bAssert);//avoid warnings
+ }
return sal_True;
}
return sal_False;
@@ -206,6 +212,8 @@ CloseableLifeTimeManager::~CloseableLifeTimeManager()
//no mutex is allowed to be acquired
{
osl::ResettableGuard< osl::Mutex > aGuard( m_aAccessMutex );
+ if( impl_isDisposedOrClosed(false) )
+ return sal_False;
//Mutex needs to be acquired exactly ones; will be released inbetween
if( !impl_canStartApiCall() )