summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2018-10-08 16:32:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-08 19:51:24 +0200
commit9ed8a1bfffd608b31badeae5341ebf0b48501419 (patch)
treec0ed025295bdde4eb960aa522fecc87a60b4000d /sfx2
parent110781a3a27dffe9e6690839bdce993796a08331 (diff)
replace double-checked locking patterns with thread safe ...
local statics. Change-Id: Iab4963a04d15f06e9b1a36079a36d32453e09c8f Reviewed-on: https://gerrit.libreoffice.org/61538 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objxtor.cxx14
1 files changed, 2 insertions, 12 deletions
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 8eef03e8d5cc..a03e3b7ddd95 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -838,19 +838,9 @@ SfxObjectShell* SfxObjectShell::GetObjectShell()
uno::Sequence< OUString > SfxObjectShell::GetEventNames()
{
- static uno::Sequence< OUString >* pEventNameContainer = nullptr;
+ static uno::Sequence< OUString > s_EventNameContainer(rtl::Reference<GlobalEventConfig>(new GlobalEventConfig)->getElementNames());
- if ( !pEventNameContainer )
- {
- SolarMutexGuard aGuard;
- if ( !pEventNameContainer )
- {
- static uno::Sequence< OUString > aEventNameContainer = rtl::Reference<GlobalEventConfig>(new GlobalEventConfig)->getElementNames();
- pEventNameContainer = &aEventNameContainer;
- }
- }
-
- return *pEventNameContainer;
+ return s_EventNameContainer;
}