diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-10-11 09:29:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-10-11 10:19:57 +0100 |
commit | 934603e069f0894b78278b39582e2c7f7a809897 (patch) | |
tree | 5a42f456d6d7811ab6999ca82d80385bc05b8967 /package/source/xstor/xstorage.cxx | |
parent | 229aa0d171e529c154438d980230ac38578387c2 (diff) |
#i112602# use rtl::Static to wrap globals
Diffstat (limited to 'package/source/xstor/xstorage.cxx')
-rw-r--r-- | package/source/xstor/xstorage.cxx | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index c6cc37f6f..40f493d28 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -49,6 +49,7 @@ #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/exc_hlp.hxx> #include <rtl/logfile.hxx> +#include <rtl/instance.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/componentcontext.hxx> @@ -2368,25 +2369,14 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes() return m_pData->m_pTypeCollection->getTypes() ; } +namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; } + //----------------------------------------------- uno::Sequence< sal_Int8 > SAL_CALL OStorage::getImplementationId() throw( uno::RuntimeException ) { - static ::cppu::OImplementationId* pID = NULL ; - - if ( pID == NULL ) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ) ; - - if ( pID == NULL ) - { - static ::cppu::OImplementationId aID( sal_False ) ; - pID = &aID ; - } - } - - return pID->getImplementationId() ; - + ::cppu::OImplementationId &rID = lcl_ImplId::get(); + return rID.getImplementationId(); } //____________________________________________________________________________________________________ |