Created
October 16, 2012 07:51
-
-
Save piaoapiao/3897886 to your computer and use it in GitHub Desktop.
leak example
This file contains hidden or 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
NSURL *tempURL = [[NSURL alloc] initWithString:hotelImage]; | |
self.hotelImg = tempURL; | |
TT_RELEASE_SAFELY(tempURL); | |
// self.hotelImg = [NSURL URLWithString:hotelImage]; | |
找到原因了,大伙看代码。。。。,正确的dealloc方法,却碰到这样蛋疼的写法。。。 感觉是过度防卫,。。。 | |
- (void)setImageURL:(NSURL *)aURL | |
{ | |
if (aURL == nil) { | |
return; | |
} | |
...... | |
} | |
- (void)dealloc { | |
self.imageURL = nil; | |
[super dealloc]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment