Replace a suspicious Guard on a solar mutex.

This site use a OClearableGuard that is being converted to a SolarMutexGuard
Guard will do... What is suspicious is the point where it is cleared.
It seems that it is way to early to serve its declared purpose.
This commit is contained in:
Norbert Thiebaud 2010-10-14 22:20:56 -05:00
parent 2622a45740
commit 86c595452b

View file

@ -532,10 +532,14 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
//is called to attach the controller to a new model.
//return true if attach was successfully, false otherwise (e.g. if you do not work with a model)
::vos::OClearableGuard aGuard( Application::GetSolarMutex());
{
// FIXME: ths is suspicious: why just proctect the call to isDisposedOrSuspened
// and not all the way until he new model is attached ?
// seems racy to me
SolarMutexGuard aGuard;
if( impl_isDisposedOrSuspended() ) //@todo? allow attaching a new model while suspended?
return sal_False; //behave passive if already disposed or suspended
aGuard.clear();
}
TheModelRef aNewModelRef( new TheModel( xModel), m_aModelMutex);