From df439565c81967872366c40a0d6a17361efea6ec Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 6 Nov 2024 08:54:40 +0000 Subject: cid#1608068 Data race condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iec72c56e1d58cbcd6463aa98e8d99d6c469c9dd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176261 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- scripting/source/stringresource/stringresource.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripting/source/stringresource/stringresource.cxx') diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index 244063ba3a5e..53802f356cd1 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -530,6 +530,8 @@ void StringResourceImpl::implScanIdForNumber( const OUString& ResourceID ) sal_Int32 StringResourceImpl::getUniqueNumericId( ) { + std::unique_lock aGuard( m_aMutex ); + if( m_nNextUniqueNumericId == UNIQUE_NUMBER_NEEDS_INITIALISATION ) { implLoadAllLocales(); @@ -1165,6 +1167,8 @@ Sequence< ::sal_Int8 > BinaryOutput::closeAndGetData() Sequence< sal_Int8 > StringResourcePersistenceImpl::exportBinary( ) { + std::unique_lock aGuard( m_aMutex ); + BinaryOutput aOut; sal_Int32 nLocaleCount = m_aLocaleItemVector.size(); -- cgit