Skip to content

Instantly share code, notes, and snippets.

@mike3k
Created March 20, 2013 04:36
Show Gist options
  • Save mike3k/5202342 to your computer and use it in GitHub Desktop.
Save mike3k/5202342 to your computer and use it in GitHub Desktop.
Most frightening piece of code I've ever seen
- (void)
dealloc
{
// because of TiledLayer ( which draws in a separate threads) and propbably a bug in iOS dealloc is called twice.
// make sure it will execute once in our class
if ( _deallocCalled )
return;
_deallocCalled = YES;
#if XXXXXX
usleep(50000);
#endif
[self disableDrawing];
CGPDFDocumentRelease(pdf);
pdf = NULL;
[_lockPdfDrawers lock];
[_lockPdfDrawers unlock];
[_lockPdfDrawers release];
_lockPdfDrawers = nil;
#if XXXXXX
usleep(200000); //wait 200 milliseconds
#endif
[super dealloc];
}
@soffes
Copy link

soffes commented Jun 10, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment