diff options
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx | 23 | ||||
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk | 4 |
2 files changed, 8 insertions, 19 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx index e841bc0c37e5..74b2b7311509 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx @@ -37,6 +37,7 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> +#include <rtl/instance.hxx> #include <osl/diagnose.h> #include <osl/mutex.hxx> @@ -230,6 +231,11 @@ static void deleteException( void * pExc ) } } +namespace +{ + struct theRTTI : public rtl::Static<RTTI, theRTTI> {}; +} + //================================================================================================== void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) { @@ -262,21 +268,8 @@ 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 ); + static RTTI &rRTTI = theRTTI::get(); + rtti = rRTTI.getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr ); TYPELIB_DANGER_RELEASE( pTypeDescr ); OSL_ENSURE( rtti, "### no rtti for throwing exception!" ); if (! rtti) diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk index f8b6d8e17b82..acc590b34a00 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk @@ -44,10 +44,6 @@ ENABLE_EXCEPTIONS=TRUE "$(COM)$(OS)$(CPU)$(COMNAME)" == "GCCNETBSDXgcc3" || \ "$(COM)$(OS)$(CPU)$(COMNAME)" == "GCCDRAGONFLYXgcc3" \ -.IF "$(cppu_no_leak)" == "" -CFLAGS += -DLEAK_STATIC_DATA -.ENDIF - # In case someone enabled the non-standard -fomit-frame-pointer which does not # work with the .cxx sources in this directory: CFLAGSCXX += -fno-omit-frame-pointer -fno-strict-aliasing |