From 9ed8a1bfffd608b31badeae5341ebf0b48501419 Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Mon, 8 Oct 2018 16:32:04 +0200 Subject: 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 --- sfx2/source/doc/objxtor.cxx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'sfx2') 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(new GlobalEventConfig)->getElementNames()); - if ( !pEventNameContainer ) - { - SolarMutexGuard aGuard; - if ( !pEventNameContainer ) - { - static uno::Sequence< OUString > aEventNameContainer = rtl::Reference(new GlobalEventConfig)->getElementNames(); - pEventNameContainer = &aEventNameContainer; - } - } - - return *pEventNameContainer; + return s_EventNameContainer; } -- cgit