Kaydet (Commit) 6dfe7e79 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Don't do any own auto-cleanup of aurorelease pools on iOS when a thread ends

According to documentation, the system does it automatically. Testing
seemed to confirm that, with the code still in I got mysterious
crashes.

Not sure if the corresponding code is unnecessary or wrong on OS X,
too.

Change-Id: I14e9f5bcc0376e9235f8d36b484b38c1e44932c4
üst 39c603ca
...@@ -24,12 +24,6 @@ ...@@ -24,12 +24,6 @@
oslThreadKey SalData::s_aAutoReleaseKey = 0; oslThreadKey SalData::s_aAutoReleaseKey = 0;
static void SAL_CALL releasePool( void* pPool )
{
if( pPool )
[(NSAutoreleasePool*)pPool release];
}
SalData::SalData() SalData::SalData()
: :
mpTimerProc( NULL ), mpTimerProc( NULL ),
...@@ -46,7 +40,7 @@ SalData::SalData() ...@@ -46,7 +40,7 @@ SalData::SalData()
mnDPIY( 0 ) mnDPIY( 0 )
{ {
if( s_aAutoReleaseKey == 0 ) if( s_aAutoReleaseKey == 0 )
s_aAutoReleaseKey = osl_createThreadKey( releasePool ); s_aAutoReleaseKey = osl_createThreadKey( NULL );
} }
SalData::~SalData() SalData::~SalData()
...@@ -55,20 +49,6 @@ SalData::~SalData() ...@@ -55,20 +49,6 @@ SalData::~SalData()
CGColorSpaceRelease( mxP50Space ); CGColorSpaceRelease( mxP50Space );
CGColorSpaceRelease( mxRGBSpace ); CGColorSpaceRelease( mxRGBSpace );
CGColorSpaceRelease( mxGraySpace ); CGColorSpaceRelease( mxGraySpace );
if( s_aAutoReleaseKey )
{
// release the last pool
NSAutoreleasePool* pPool = nil;
pPool = reinterpret_cast<NSAutoreleasePool*>( osl_getThreadKeyData( s_aAutoReleaseKey ) );
if( pPool )
{
osl_setThreadKeyData( s_aAutoReleaseKey, NULL );
[pPool release];
}
osl_destroyThreadKey( s_aAutoReleaseKey );
s_aAutoReleaseKey = 0;
}
} }
void SalData::ensureThreadAutoreleasePool() void SalData::ensureThreadAutoreleasePool()
......
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