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:
parent
2622a45740
commit
86c595452b
1 changed files with 8 additions and 4 deletions
|
@ -532,10 +532,14 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
|
||||||
//is called to attach the controller to a new model.
|
//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)
|
//return true if attach was successfully, false otherwise (e.g. if you do not work with a model)
|
||||||
|
|
||||||
::vos::OClearableGuard aGuard( Application::GetSolarMutex());
|
{
|
||||||
if( impl_isDisposedOrSuspended() ) //@todo? allow attaching a new model while suspended?
|
// FIXME: ths is suspicious: why just proctect the call to isDisposedOrSuspened
|
||||||
return sal_False; //behave passive if already disposed or suspended
|
// and not all the way until he new model is attached ?
|
||||||
aGuard.clear();
|
// 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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
TheModelRef aNewModelRef( new TheModel( xModel), m_aModelMutex);
|
TheModelRef aNewModelRef( new TheModel( xModel), m_aModelMutex);
|
||||||
|
|
Loading…
Reference in a new issue