summaryrefslogtreecommitdiff
path: root/cppuhelper/source/implbase.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-07-11 09:41:51 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-07-11 09:41:51 +0000
commit8697916f1fde5b6be2b430669f3e8ac5cda3b9b3 (patch)
tree17f4926c73d2a3ca66f2a3a0728235a026197f55 /cppuhelper/source/implbase.cxx
parent507ee8a40f2b34b297a2fac118bd02eeae8764e7 (diff)
INTEGRATION: CWS dborc3 (1.10.14); FILE MERGED
2003/07/09 11:41:12 dbo 1.10.14.2: #110657# keeping self alive 2003/07/09 08:57:05 dbo 1.10.14.1: #110657# no catch (...)
Diffstat (limited to 'cppuhelper/source/implbase.cxx')
-rw-r--r--cppuhelper/source/implbase.cxx84
1 files changed, 36 insertions, 48 deletions
diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx
index f133725059bf..b02a48ab06de 100644
--- a/cppuhelper/source/implbase.cxx
+++ b/cppuhelper/source/implbase.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: implbase.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: vg $ $Date: 2003-04-15 16:34:42 $
+ * last change: $Author: vg $ $Date: 2003-07-11 10:41:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -337,43 +337,37 @@ void WeakComponentImplHelperBase::dispose()
aGuard.clear();
try
{
+ // side effect: keeping a reference to this
lang::EventObject aEvt( static_cast< OWeakObject * >( this ) );
- rBHelper.aLC.disposeAndClear( aEvt );
- disposing();
+ try
+ {
+ rBHelper.aLC.disposeAndClear( aEvt );
+ disposing();
+ }
+ catch (...)
+ {
+ MutexGuard aGuard( rBHelper.rMutex );
+ // bDisposed and bInDispose must be set in this order:
+ rBHelper.bDisposed = sal_True;
+ rBHelper.bInDispose = sal_False;
+ throw;
+ }
MutexGuard aGuard( rBHelper.rMutex );
+ // bDisposed and bInDispose must be set in this order:
rBHelper.bDisposed = sal_True;
rBHelper.bInDispose = sal_False;
}
catch (RuntimeException &)
{
- MutexGuard aGuard( rBHelper.rMutex );
- rBHelper.bDisposed = sal_True;
- rBHelper.bInDispose = sal_False;
throw;
}
catch (Exception & exc)
{
- MutexGuard aGuard( rBHelper.rMutex );
- rBHelper.bDisposed = sal_True;
- rBHelper.bInDispose = sal_False;
-#if OSL_DEBUG_LEVEL > 0
- OString msg( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
- OSL_ENSURE( 0, msg.getStr() );
-#endif
throw RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM("unexpected UNO exception caught: ") ) +
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "unexpected UNO exception caught: ") ) +
exc.Message, Reference< XInterface >() );
}
- catch (...)
- {
- MutexGuard aGuard( rBHelper.rMutex );
- rBHelper.bDisposed = sal_True;
- rBHelper.bInDispose = sal_False;
- OSL_ENSURE( 0, "### unexpected non-UNO exception caught!" );
- throw RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM("unexpected non-UNO exception caught!") ),
- Reference< XInterface >() );
- }
}
}
//__________________________________________________________________________________________________
@@ -472,43 +466,37 @@ void WeakAggComponentImplHelperBase::dispose()
aGuard.clear();
try
{
+ // side effect: keeping a reference to this
lang::EventObject aEvt( static_cast< OWeakObject * >( this ) );
- rBHelper.aLC.disposeAndClear( aEvt );
- disposing();
+ try
+ {
+ rBHelper.aLC.disposeAndClear( aEvt );
+ disposing();
+ }
+ catch (...)
+ {
+ MutexGuard aGuard( rBHelper.rMutex );
+ // bDisposed and bInDispose must be set in this order:
+ rBHelper.bDisposed = sal_True;
+ rBHelper.bInDispose = sal_False;
+ throw;
+ }
MutexGuard aGuard( rBHelper.rMutex );
+ // bDisposed and bInDispose must be set in this order:
rBHelper.bDisposed = sal_True;
rBHelper.bInDispose = sal_False;
}
catch (RuntimeException &)
{
- MutexGuard aGuard( rBHelper.rMutex );
- rBHelper.bDisposed = sal_True;
- rBHelper.bInDispose = sal_False;
throw;
}
catch (Exception & exc)
{
- MutexGuard aGuard( rBHelper.rMutex );
- rBHelper.bDisposed = sal_True;
- rBHelper.bInDispose = sal_False;
-#if OSL_DEBUG_LEVEL > 0
- OString msg( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
- OSL_ENSURE( 0, msg.getStr() );
-#endif
throw RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM("unexpected UNO exception caught: ") ) +
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "unexpected UNO exception caught: ") ) +
exc.Message, Reference< XInterface >() );
}
- catch (...)
- {
- MutexGuard aGuard( rBHelper.rMutex );
- rBHelper.bDisposed = sal_True;
- rBHelper.bInDispose = sal_False;
- OSL_ENSURE( 0, "### unexpected non-UNO exception caught!" );
- throw RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM("unexpected non-UNO exception caught!") ),
- Reference< XInterface >() );
- }
}
}
//__________________________________________________________________________________________________