diff options
Diffstat (limited to 'bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx')
-rw-r--r-- | bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx index 27879b066a59..090ec5c13e38 100644 --- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx +++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx @@ -681,19 +681,13 @@ ExceptionInfos::ExceptionInfos() throw () RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw () { - static ExceptionInfos * s_pInfos = nullptr; - if (! s_pInfos) - { - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if (! s_pInfos) - { - SYSTEM_INFO systemInfo; - GetSystemInfo( &systemInfo ); - allocationGranularity = systemInfo.dwAllocationGranularity; + static ExceptionInfos* s_pInfos = []() { + SYSTEM_INFO systemInfo; + GetSystemInfo(&systemInfo); + allocationGranularity = systemInfo.dwAllocationGranularity; - s_pInfos = new ExceptionInfos(); - } - } + return new ExceptionInfos(); + }(); assert( pTD && (pTD->eTypeClass == typelib_TypeClass_STRUCT || @@ -726,29 +720,13 @@ RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw type_info * mscx_getRTTI( OUString const & rUNOname ) { - static RTTInfos * s_pRTTIs = nullptr; - if (! s_pRTTIs) - { - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if (! s_pRTTIs) - { - s_pRTTIs = new RTTInfos(); - } - } + static RTTInfos* s_pRTTIs = new RTTInfos(); return s_pRTTIs->getRTTI( rUNOname ); } int mscx_getRTTI_len( OUString const & rUNOname) { - static RTTInfos * s_pRTTIs = nullptr; - if (!s_pRTTIs) - { - MutexGuard aGuard(Mutex::getGlobalMutex()); - if (!s_pRTTIs) - { - s_pRTTIs = new RTTInfos(); - } - } + static RTTInfos* s_pRTTIs = new RTTInfos(); return s_pRTTIs->getRTTI_len(rUNOname); } |