sb140: #i117295# use rtl::Static
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user