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
This commit is contained in:
Vladimir Glazounov 2005-03-10 14:44:42 +00:00
parent 7d1c1393ee
commit af2e47ab30

View file

@ -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 )
{
// #62337# Ohne Model wollen wir nicht weiterleben
// 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# 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;
}
}