diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-06-17 12:00:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-17 13:28:18 +0200 |
commit | d69795b9c9d2dac7b751c6fe8b4663c0c26a129b (patch) | |
tree | e900e25a1055aa46c3b54a63bb256a82cba370c6 /xmlhelp/source/cxxhelp/provider/content.cxx | |
parent | 76ed00f8db34490d5e21c72d142e11da510ac605 (diff) |
use local statics in getTypes functions
... instead of double checked locking patterns.
Change-Id: I1b86ce723ff22dd357b3ed69a52757b085472424
Reviewed-on: https://gerrit.libreoffice.org/38906
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlhelp/source/cxxhelp/provider/content.cxx')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/content.cxx | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index beb3213eed41..1b7deb82f305 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -83,15 +83,8 @@ XTYPEPROVIDER_COMMON_IMPL( Content ); // virtual uno::Sequence< uno::Type > SAL_CALL Content::getTypes() { - static cppu::OTypeCollection* pCollection = nullptr; - - if ( !pCollection ) - { - osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ); - if ( !pCollection ) - { - static cppu::OTypeCollection aCollection( - CPPU_TYPE_REF( lang::XTypeProvider ), + static cppu::OTypeCollection ourTypeCollection( + CPPU_TYPE_REF( lang::XTypeProvider ), CPPU_TYPE_REF( lang::XServiceInfo ), CPPU_TYPE_REF( lang::XComponent ), CPPU_TYPE_REF( ucb::XContent ), @@ -101,11 +94,8 @@ uno::Sequence< uno::Type > SAL_CALL Content::getTypes() CPPU_TYPE_REF( beans::XPropertyContainer ), CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), CPPU_TYPE_REF( container::XChild ) ); - pCollection = &aCollection; - } - } - return (*pCollection).getTypes(); + return ourTypeCollection.getTypes(); } // XServiceInfo methods. |