summaryrefslogtreecommitdiffstats
path: root/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-09-09 17:31:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2011-09-09 17:46:39 +0200
commitd3794d2d8ab2ee3f8118d61538bb753335b37f23 (patch)
tree6c5c0ab6baca8759474790cea1475c8dae2cb1b7 /bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx
parentsb140: #i117294# removed unused mutex guard (diff)
downloadcore-d3794d2d8ab2ee3f8118d61538bb753335b37f23.tar.gz
core-d3794d2d8ab2ee3f8118d61538bb753335b37f23.zip
sb140: #i117295# use rtl::Static
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx')
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx20
1 files changed, 4 insertions, 16 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx
index f95848008920..da3df3479d62 100644
--- a/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_sparc/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 )
{
@@ -251,22 +254,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)