scripting/source/stringresource/stringresource.cxx | 4 ++++ 1 file changed, 4 insertions(+)
New commits: commit df439565c81967872366c40a0d6a17361efea6ec Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Nov 6 08:54:40 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Fri Nov 8 12:56:32 2024 +0100 cid#1608068 Data race condition Change-Id: Iec72c56e1d58cbcd6463aa98e8d99d6c469c9dd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176261 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins 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();