diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-07-11 09:41:40 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-07-11 09:41:40 +0000 |
commit | 507ee8a40f2b34b297a2fac118bd02eeae8764e7 (patch) | |
tree | 37227012e7797983d1a42d018c4c249263a484d6 /cppuhelper/source/component.cxx | |
parent | ddbeb2d7103970d3d5956403b14a55d3909e5e90 (diff) |
INTEGRATION: CWS dborc3 (1.9.14); FILE MERGED
2003/07/09 08:57:05 dbo 1.9.14.1: #110657# no catch (...)
Diffstat (limited to 'cppuhelper/source/component.cxx')
-rw-r--r-- | cppuhelper/source/component.cxx | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/cppuhelper/source/component.cxx b/cppuhelper/source/component.cxx index 584d2af09014..3e3f6d8cf135 100644 --- a/cppuhelper/source/component.cxx +++ b/cppuhelper/source/component.cxx @@ -2,9 +2,9 @@ * * $RCSfile: component.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: vg $ $Date: 2003-04-15 16:34:12 $ + * last change: $Author: vg $ $Date: 2003-07-11 10:41:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -207,52 +207,47 @@ void OComponentHelper::dispose() // Create an event with this as sender try { - Reference<XInterface > xSource( Reference<XInterface >::query( (XComponent *)this ) ); - EventObject aEvt; - aEvt.Source = xSource; - // inform all listeners to release this object - // The listener container are automaticly cleared - rBHelper.aLC.disposeAndClear( aEvt ); - // notify subclasses to do their dispose - disposing(); - } - catch(::com::sun::star::uno::RuntimeException&) - { - // catch exception and throw again but signal that - // the object was disposed. Dispose should be called - // only once. + try + { + Reference<XInterface > xSource( + Reference<XInterface >::query( (XComponent *)this ) ); + EventObject aEvt; + aEvt.Source = xSource; + // inform all listeners to release this object + // The listener container are automaticly cleared + rBHelper.aLC.disposeAndClear( aEvt ); + // notify subclasses to do their dispose + disposing(); + } + catch (...) + { + MutexGuard aGuard( rBHelper.rMutex ); + // bDispose and bInDisposing must be set in this order: + rBHelper.bDisposed = sal_True; + rBHelper.bInDispose = sal_False; + throw; + } MutexGuard aGuard( rBHelper.rMutex ); + // bDispose and bInDisposing must be set in this order: rBHelper.bDisposed = sal_True; rBHelper.bInDispose = sal_False; - throw; } - catch (::com::sun::star::uno::Exception & exc) + catch (RuntimeException &) { - MutexGuard aGuard( rBHelper.rMutex ); - rBHelper.bDisposed = sal_True; - rBHelper.bInDispose = sal_False; - throw RuntimeException( - OUString( RTL_CONSTASCII_USTRINGPARAM("unexpected UNO exception caught: ") ) + - exc.Message, Reference< XInterface >() ); + throw; } - catch (...) + catch (Exception & exc) { - MutexGuard aGuard( rBHelper.rMutex ); - rBHelper.bDisposed = sal_True; - rBHelper.bInDispose = sal_False; throw RuntimeException( - OUString( RTL_CONSTASCII_USTRINGPARAM("unexpected non-UNO exception caught: ") ), - Reference< XInterface >() ); + OUString( RTL_CONSTASCII_USTRINGPARAM( + "unexpected UNO exception caught: ") ) + + exc.Message, Reference< XInterface >() ); } - - // the values bDispose and bInDisposing must set in this order. - MutexGuard aGuard( rBHelper.rMutex ); - rBHelper.bDisposed = sal_True; - rBHelper.bInDispose = sal_False; } else { - // in a multithreaded environment, it can't be avoided, that dispose is called twice. + // in a multithreaded environment, it can't be avoided, + // that dispose is called twice. // However this condition is traced, because it MAY indicate an error. OSL_TRACE( "OComponentHelper::dispose() - dispose called twice" ); } |