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/gcc3_aix_powerpc | |
parent | afe7061d8ba46629f610991b5d35f5e0668fcf89 (diff) |
sb140: #i117295# use rtl::Static
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_aix_powerpc')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx index 2086ef7e7bba..6ce9103160ba 100644 --- a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx +++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx @@ -34,6 +34,7 @@ #include <cxxabi.h> #include <boost/unordered_map.hpp> +#include <rtl/instance.hxx> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include <osl/diagnose.h> @@ -205,6 +206,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR return rtti; } +struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {}; + //-------------------------------------------------------------------------------------------------- static void deleteException( void * pExc ) { @@ -240,21 +243,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) // destruct uno exception ::uno_any_destruct( pUnoExc, 0 ); // avoiding locked counts - static RTTI * s_rtti = 0; - if (! s_rtti) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if (! s_rtti) - { -#ifdef LEAK_STATIC_DATA - s_rtti = new RTTI(); -#else - static RTTI rtti_data; - s_rtti = &rtti_data; -#endif - } - } - rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr ); + rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr ); TYPELIB_DANGER_RELEASE( pTypeDescr ); OSL_ENSURE( rtti, "### no rtti for throwing exception!" ); if (! rtti) |