diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-11-06 08:54:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-11-08 12:56:32 +0100 |
commit | df439565c81967872366c40a0d6a17361efea6ec (patch) | |
tree | 51d012254631cb66a36a3916ee97615d8f5cbb0e /scripting/source/stringresource/stringresource.cxx | |
parent | d86360c7d0ed6cfd35f9d64503d019922b3333ee (diff) |
cid#1608068 Data race condition
Change-Id: Iec72c56e1d58cbcd6463aa98e8d99d6c469c9dd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176261
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'scripting/source/stringresource/stringresource.cxx')
-rw-r--r-- | scripting/source/stringresource/stringresource.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
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(); |