summaryrefslogtreecommitdiff
path: root/chart2/source/tools
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
commit48f8256c1985559f0a717090e1514f8903efebad (patch)
treea0de470464b83526f39ed5b2078347795187fcb4 /chart2/source/tools
parent45f10580f59f84ca69adc591b85db631f38c1b68 (diff)
chart47: #i109770# #i110253# reduce assertions 'already disposed or closed'
Diffstat (limited to 'chart2/source/tools')
-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 46bf42730..c49010653 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() )