diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-17 21:50:01 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-17 22:52:27 +0200 |
commit | c5aef25352d20e052ec3a697f3cb979d3bbf9df6 (patch) | |
tree | 82cf890fca4a6d1830f956b9e5e75fb418594e36 /sc | |
parent | 8aec73d7a93b37778198d416ca4ef285734f2024 (diff) |
Use atomic::exchange when cleaning up
Change-Id: I77b8093efba3f3dfe96f6e3a4f4bfcc8dd89ccff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122273
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/global.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index cbc2bcec709d..e795912dd2e3 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -527,8 +527,8 @@ void ScGlobal::Clear() ExitExternalFunc(); ClearAutoFormat(); xSearchItem.reset(); - delete pLegacyFuncCollection.load(); pLegacyFuncCollection = nullptr; - delete pAddInCollection.load(); pAddInCollection = nullptr; + delete pLegacyFuncCollection.exchange(nullptr); + delete pAddInCollection.exchange(nullptr); xUserList.reset(); xStarCalcFunctionList.reset(); // Destroy before ResMgr! xStarCalcFunctionMgr.reset(); @@ -539,15 +539,15 @@ void ScGlobal::Clear() xEmptyBrushItem.reset(); xButtonBrushItem.reset(); xEnglishFormatter.reset(); - delete pCaseTransliteration.load(); pCaseTransliteration = nullptr; - delete pTransliteration.load(); pTransliteration = nullptr; - delete pCaseCollator.load(); pCaseCollator = nullptr; - delete pCollator.load(); pCollator = nullptr; + delete pCaseTransliteration.exchange(nullptr); + delete pTransliteration.exchange(nullptr); + delete pCaseCollator.exchange(nullptr); + delete pCollator.exchange(nullptr); oCalendar.reset(); oSysLocale.reset(); - delete pLocale.load(); pLocale = nullptr; + delete pLocale.exchange(nullptr); - delete pUnitConverter.load(); pUnitConverter = nullptr; + delete pUnitConverter.exchange(nullptr); xFieldEditEngine.reset(); xDrawClipDocShellRef.clear(); |