diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2005-03-10 14:44:42 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2005-03-10 14:44:42 +0000 |
commit | af2e47ab3092dbbe04ea5b94da8ae50621b3b61f (patch) | |
tree | f534367da7659f77d34f0e440bb293791f609752 /toolkit | |
parent | 7d1c1393eecf0cfcce06f35b0b18311f1e887aee (diff) |
INTEGRATION: CWS dba24 (1.32.10); FILE MERGED
2005/02/14 10:14:59 fs 1.32.10.1: #i42573# some thread and exception safety
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/unocontrol.cxx | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index d5ca2a0f990d..027f50887b45 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unocontrol.cxx,v $ * - * $Revision: 1.32 $ + * $Revision: 1.33 $ * - * last change: $Author: kz $ $Date: 2005-01-21 16:47:07 $ + * last change: $Author: vg $ $Date: 2005-03-10 15:44:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -283,7 +283,15 @@ Reference< XWindowPeer > UnoControl::ImplGetCompatiblePeer( sal_Bool bAcceptE osl::Guard< vos::IMutex > aGuard( Application::GetSolarMutex() ); pWW = lcl_GetDefaultWindow(); } - xMe->createPeer( NULL, pWW->GetComponentInterface( sal_True ) ); + try + { + xMe->createPeer( NULL, pWW->GetComponentInterface( sal_True ) ); + } + catch( const Exception& ) + { + mbCreatingCompatiblePeer = sal_False; + throw; + } xCompatiblePeer = getPeer(); setPeer( xCurrentPeer ); @@ -565,23 +573,25 @@ void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent void UnoControl::disposing( const EventObject& rEvt ) throw(RuntimeException) { - ::osl::MutexGuard aGuard( GetMutex() ); + ::osl::ClearableMutexGuard aGuard( GetMutex() ); // bei "Multible Inheritance" nicht unterschiedliche Typen vergleichen. - if( mxModel.get() == Reference< XControlModel >(rEvt.Source,UNO_QUERY).get() ) + if ( maAccessibleContext.get() == rEvt.Source ) + { + // just in case the context is disposed, but not released - ensure that we do not re-use it in the future + maAccessibleContext = NULL; + } + else if( mxModel.get() == Reference< XControlModel >(rEvt.Source,UNO_QUERY).get() ) { - // #62337# Ohne Model wollen wir nicht weiterleben + // #62337# if the model dies, it does not make sense for us to live ... Reference< XControl > xThis = this; + + aGuard.clear(); xThis->dispose(); DBG_ASSERT( !mxModel.is(), "UnoControl::disposing: invalid dispose behaviour!" ); mxModel.clear(); } - else if ( maAccessibleContext.get() == rEvt.Source ) - { - // just in case the context is disposed, but not released - ensure that we do not re-use it in the future - maAccessibleContext = NULL; - } } |