From d3794d2d8ab2ee3f8118d61538bb753335b37f23 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 9 Sep 2011 17:31:07 +0200 Subject: sb140: #i117295# use rtl::Static --- bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'bridges/source/cpp_uno/gcc3_linux_s390x') diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx index ea4188bac998..337ceff5b9eb 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -206,6 +207,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,22 +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) -- cgit