diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-09-09 17:31:07 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-09-09 17:46:39 +0200 |
commit | d3794d2d8ab2ee3f8118d61538bb753335b37f23 (patch) | |
tree | 6c5c0ab6baca8759474790cea1475c8dae2cb1b7 /bridges/source/cpp_uno/msvc_win32_x86-64 | |
parent | afe7061d8ba46629f610991b5d35f5e0668fcf89 (diff) |
sb140: #i117295# use rtl::Static
Diffstat (limited to 'bridges/source/cpp_uno/msvc_win32_x86-64')
-rw-r--r-- | bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx | 19 |
1 files changed, 4 insertions, 15 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 2157568ad915..ac0da414d402 100644 --- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx +++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx @@ -254,6 +254,7 @@ void #include <signal.h> #include "rtl/alloc.h" +#include <rtl/instance.hxx> #include "rtl/strbuf.hxx" #include "rtl/ustrbuf.hxx" @@ -660,24 +661,12 @@ RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw return pRaiseInfo; } +struct RTTISingleton: public rtl::Static< RTTInfos, RTTISingleton > {}; + type_info * mscx_getRTTI( OUString const & rUNOname ) { - static RTTInfos * s_pRTTIs = 0; - if (! s_pRTTIs) - { - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if (! s_pRTTIs) - { -#ifdef LEAK_STATIC_DATA - s_pRTTIs = new RTTInfos(); -#else - static RTTInfos s_aRTTIs; - s_pRTTIs = &s_aRTTIs; -#endif - } - } - return s_pRTTIs->getRTTI( rUNOname ); + return RTTISingleton::get().getRTTI( rUNOname ); } void mscx_raiseException( |