Last active
March 17, 2019 16:55
-
-
Save quentinfasquel/fd21fce61bdfe750ef1500e7cc1534fb 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
#import "LeakTest.h" | |
#import "FailingObject.h" | |
@interface LeakTest () | |
@property (nonatomic, strong) FailingObject *object; | |
@end | |
@implementation LeakTest | |
- (void)performFailure { | |
_object = [[FailingObject alloc] init]; | |
@try { | |
[self.object doFail]; | |
// [_object doFail]; // This would not leak `object`. | |
} @catch (NSException *exception) { | |
NSLog(@"Caught excepetion: %@", exception.description); | |
} @finally { | |
NSLog(@"finally"); | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment