cid#1608390 Data race condition

Change-Id: I98a8addad50888e5969fce5bf47d67f96b06ecf0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174359
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2024-10-01 19:23:34 +02:00 committed by Noel Grandin
parent 9ea9c6f0fc
commit 3b60abdc94

View file

@ -1241,13 +1241,10 @@ const Reference< XContent > & Content_Impl::getContent_NoLock()
Reference< XCommandProcessor > Content_Impl::getCommandProcessor()
{
if ( !m_xCommandProcessor.is() )
{
std::unique_lock aGuard( m_aMutex );
std::unique_lock aGuard( m_aMutex );
if ( !m_xCommandProcessor.is() )
m_xCommandProcessor.set( getContent_NoLock(), UNO_QUERY );
}
if ( !m_xCommandProcessor.is() )
m_xCommandProcessor.set( getContent_NoLock(), UNO_QUERY );
return m_xCommandProcessor;
}