summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-06-17 12:00:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-17 13:28:18 +0200
commitd69795b9c9d2dac7b751c6fe8b4663c0c26a129b (patch)
treee900e25a1055aa46c3b54a63bb256a82cba370c6 /unotools
parent76ed00f8db34490d5e21c72d142e11da510ac605 (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 'unotools')
-rw-r--r--unotools/source/ucbhelper/xtempfile.cxx15
1 files changed, 3 insertions, 12 deletions
diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx
index 9482a75598d6..eee00a7dde51 100644
--- a/unotools/source/ucbhelper/xtempfile.cxx
+++ b/unotools/source/ucbhelper/xtempfile.cxx
@@ -74,20 +74,11 @@ throw ()
css::uno::Sequence< css::uno::Type > SAL_CALL OTempFileService::getTypes( )
{
- static ::cppu::OTypeCollection* pTypeCollection = nullptr;
- if ( pTypeCollection == nullptr )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-
- if ( pTypeCollection == nullptr )
- {
- static ::cppu::OTypeCollection aTypeCollection(
+ static ::cppu::OTypeCollection ourTypeCollection(
cppu::UnoType<css::beans::XPropertySet>::get()
,OTempFileBase::getTypes() );
- pTypeCollection = &aTypeCollection;
- }
- }
- return pTypeCollection->getTypes();
+
+ return ourTypeCollection.getTypes();
};
// XTempFile