Created
May 25, 2012 19:13
-
-
Save rustle/2789971 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before @autoreleasepool a fairly common pattern in a try catch would be the following | |
NSAutoreleasePool *aPool = [[NSAutoreleasePool alloc] init]; | |
@try { | |
} | |
@catch (NSException *anException) { | |
} | |
@finally { | |
[aPool drain]; | |
} | |
I believe the theory being that you try to clean up what you can in the @finally even though you would likely still leak some objects. | |
With @autoreleasepool there doesn't seem to be a way to do this: | |
http://clang.llvm.org/docs/AutomaticReferenceCounting.html#autoreleasepool | |
Is it fair to say that the drain in the old style was more handwaving than helpful or is @autoreleasepool worse in this regard than the object version? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment