Kaydet (Commit) c26d6edb authored tarafından Stephan Bergmann's avatar Stephan Bergmann

LEAK_STATIC_DATA is always defined for WNT

cppu_no_leak and bndchk were remnants from pre-gbuild times

Change-Id: Ie9f325c20e39c100b4a7180a9925559f58bcca6b
Reviewed-on: https://gerrit.libreoffice.org/34153Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 6d15d4a6
...@@ -195,13 +195,6 @@ $(eval $(call gb_Library_add_defs,$(gb_CPPU_ENV)_uno,\ ...@@ -195,13 +195,6 @@ $(eval $(call gb_Library_add_defs,$(gb_CPPU_ENV)_uno,\
-DHAVE_POSIX_FALLOCATE \ -DHAVE_POSIX_FALLOCATE \
)) ))
endif endif
ifeq ($(OS),WNT)
$(eval $(call gb_Library_add_defs,$(gb_CPPU_ENV)_uno,\
$(if $(cppu_no_leak)$(bndchk),,\
-DLEAK_STATIC_DATA \
) \
))
endif
# In case someone enabled the non-standard -fomit-frame-pointer which does not # In case someone enabled the non-standard -fomit-frame-pointer which does not
# work with the .cxx sources of this library. # work with the .cxx sources of this library.
......
...@@ -391,12 +391,7 @@ void * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTypeDescr ) thro ...@@ -391,12 +391,7 @@ void * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTypeDescr ) thro
MutexGuard aGuard( Mutex::getGlobalMutex() ); MutexGuard aGuard( Mutex::getGlobalMutex() );
if (! s_pInfos) if (! s_pInfos)
{ {
#ifdef LEAK_STATIC_DATA
s_pInfos = new ExceptionInfos(); s_pInfos = new ExceptionInfos();
#else
static ExceptionInfos s_allExceptionInfos;
s_pInfos = &s_allExceptionInfos;
#endif
} }
} }
...@@ -439,12 +434,7 @@ type_info * msci_getRTTI( OUString const & rUNOname ) ...@@ -439,12 +434,7 @@ type_info * msci_getRTTI( OUString const & rUNOname )
MutexGuard aGuard( Mutex::getGlobalMutex() ); MutexGuard aGuard( Mutex::getGlobalMutex() );
if (! s_pRTTIs) if (! s_pRTTIs)
{ {
#ifdef LEAK_STATIC_DATA
s_pRTTIs = new RTTInfos(); s_pRTTIs = new RTTInfos();
#else
static RTTInfos s_aRTTIs;
s_pRTTIs = &s_aRTTIs;
#endif
} }
} }
return s_pRTTIs->getRTTI( rUNOname ); return s_pRTTIs->getRTTI( rUNOname );
......
...@@ -320,9 +320,6 @@ public: ...@@ -320,9 +320,6 @@ public:
type_info_descriptor * insert_new_type_info_descriptor(OUString const & rUNOname); type_info_descriptor * insert_new_type_info_descriptor(OUString const & rUNOname);
RTTInfos() throw (); RTTInfos() throw ();
#if !defined LEAK_STATIC_DATA
~RTTInfos() throw ();
#endif
}; };
class type_info_ class type_info_
{ {
...@@ -429,22 +426,6 @@ RTTInfos::RTTInfos() throw () ...@@ -429,22 +426,6 @@ RTTInfos::RTTInfos() throw ()
{ {
} }
#if !defined LEAK_STATIC_DATA
RTTInfos::~RTTInfos() throw ()
{
SAL_INFO("bridges", "> freeing generated RTTI infos... <");
MutexGuard aGuard( _aMutex );
for ( t_string2PtrMap::const_iterator iPos( _allRTTI.begin() );
iPos != _allRTTI.end(); ++iPos )
{
type_info_ * pType = static_cast<type_info_ *>(iPos->second);
pType->~type_info_(); // obsolete, but good style...
::rtl_freeMemory( pType );
}
}
#endif
void * __cdecl copyConstruct( void * __cdecl copyConstruct(
void * pExcThis, void * pExcThis,
void * pSource, void * pSource,
...@@ -556,9 +537,6 @@ public: ...@@ -556,9 +537,6 @@ public:
static DWORD allocationGranularity; static DWORD allocationGranularity;
ExceptionInfos() throw (); ExceptionInfos() throw ();
#if !defined LEAK_STATIC_DATA
~ExceptionInfos() throw ();
#endif
}; };
DWORD ExceptionInfos::allocationGranularity = 0; DWORD ExceptionInfos::allocationGranularity = 0;
...@@ -578,10 +556,6 @@ struct RaiseInfo ...@@ -578,10 +556,6 @@ struct RaiseInfo
sal_uInt64 _codeBase; sal_uInt64 _codeBase;
explicit RaiseInfo(typelib_TypeDescription * pTD) throw (); explicit RaiseInfo(typelib_TypeDescription * pTD) throw ();
#if !defined LEAK_STATIC_DATA
~RaiseInfo() throw ();
#endif
}; };
/* Rewrite of 32-Bit-Code to work under 64 Bit: /* Rewrite of 32-Bit-Code to work under 64 Bit:
...@@ -702,41 +676,10 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw () ...@@ -702,41 +676,10 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw ()
assert(etMem + etMemOffset == pCode + totalSize); assert(etMem + etMemOffset == pCode + totalSize);
} }
#if !defined LEAK_STATIC_DATA
RaiseInfo::~RaiseInfo() throw ()
{
sal_uInt32 * pTypes = reinterpret_cast<sal_uInt32 *>(_codeBase + _types) + 1;
// Because of placement new we have to call D.-tor, not delete!
for ( int nTypes = *reinterpret_cast<sal_uInt32 *>(_codeBase + _types); nTypes--; )
{
ExceptionType *et = reinterpret_cast<ExceptionType *>(_codeBase + pTypes[nTypes]);
et->~ExceptionType();
}
// free our single block
::rtl_freeMemory( _code );
::typelib_typedescription_release( _pTD );
}
#endif
ExceptionInfos::ExceptionInfos() throw () ExceptionInfos::ExceptionInfos() throw ()
{ {
} }
#if !defined LEAK_STATIC_DATA
ExceptionInfos::~ExceptionInfos() throw ()
{
SAL_INFO("bridges", "> freeing exception infos... <");
MutexGuard aGuard( _aMutex );
for ( t_string2PtrMap::const_iterator iPos( _allRaiseInfos.begin() );
iPos != _allRaiseInfos.end(); ++iPos )
{
delete static_cast<RaiseInfo *>(iPos->second);
}
}
#endif
RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw () RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw ()
{ {
static ExceptionInfos * s_pInfos = nullptr; static ExceptionInfos * s_pInfos = nullptr;
...@@ -749,12 +692,7 @@ RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw ...@@ -749,12 +692,7 @@ RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw
GetSystemInfo( &systemInfo ); GetSystemInfo( &systemInfo );
allocationGranularity = systemInfo.dwAllocationGranularity; allocationGranularity = systemInfo.dwAllocationGranularity;
#ifdef LEAK_STATIC_DATA
s_pInfos = new ExceptionInfos(); s_pInfos = new ExceptionInfos();
#else
static ExceptionInfos s_allExceptionInfos;
s_pInfos = &s_allExceptionInfos;
#endif
} }
} }
...@@ -795,12 +733,7 @@ type_info * mscx_getRTTI( ...@@ -795,12 +733,7 @@ type_info * mscx_getRTTI(
MutexGuard aGuard( Mutex::getGlobalMutex() ); MutexGuard aGuard( Mutex::getGlobalMutex() );
if (! s_pRTTIs) if (! s_pRTTIs)
{ {
#ifdef LEAK_STATIC_DATA
s_pRTTIs = new RTTInfos(); s_pRTTIs = new RTTInfos();
#else
static RTTInfos s_aRTTIs;
s_pRTTIs = &s_aRTTIs;
#endif
} }
} }
return s_pRTTIs->getRTTI( rUNOname ); return s_pRTTIs->getRTTI( rUNOname );
...@@ -814,12 +747,7 @@ int mscx_getRTTI_len( ...@@ -814,12 +747,7 @@ int mscx_getRTTI_len(
MutexGuard aGuard(Mutex::getGlobalMutex()); MutexGuard aGuard(Mutex::getGlobalMutex());
if (!s_pRTTIs) if (!s_pRTTIs)
{ {
#ifdef LEAK_STATIC_DATA
s_pRTTIs = new RTTInfos(); s_pRTTIs = new RTTInfos();
#else
static RTTInfos s_aRTTIs;
s_pRTTIs = &s_aRTTIs;
#endif
} }
} }
return s_pRTTIs->getRTTI_len(rUNOname); return s_pRTTIs->getRTTI_len(rUNOname);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment