Add macro for ARC conditional call to [super dealloc]
This commit is contained in:
parent
dcc6673bf1
commit
ab97899a23
|
@ -81,9 +81,7 @@ static SDImageCache *instance;
|
|||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
[super dealloc];
|
||||
#endif
|
||||
SDWISuperDealoc;
|
||||
}
|
||||
|
||||
#pragma mark SDImageCache (class methods)
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#define SDWIReturnRetained SDWIRetain
|
||||
|
||||
#define SDWIRelease(__v) ([__v release], __v = nil);
|
||||
#define SDWISuperDealoc [super dealloc];
|
||||
|
||||
#define SDWIWeak
|
||||
#else
|
||||
|
@ -40,6 +41,7 @@
|
|||
#define SDWIReturnRetained(__v) (__v)
|
||||
|
||||
#define SDWIRelease(__v)
|
||||
#define SDWISuperDealoc
|
||||
|
||||
#define SDWIWeak __unsafe_unretained
|
||||
#endif
|
||||
|
|
|
@ -77,10 +77,7 @@ static SDWebImageDecoder *sharedInstance;
|
|||
- (void)dealloc
|
||||
{
|
||||
SDWIRelease(imageDecodingQueue);
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
[super dealloc];
|
||||
#endif
|
||||
SDWISuperDealoc;
|
||||
}
|
||||
|
||||
+ (SDWebImageDecoder *)sharedImageDecoder
|
||||
|
|
|
@ -157,10 +157,7 @@ NSString *const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNot
|
|||
SDWIRelease(connection);
|
||||
SDWIRelease(imageData);
|
||||
SDWIRelease(userInfo);
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
[super dealloc];
|
||||
#endif
|
||||
SDWISuperDealoc;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -52,10 +52,7 @@ static SDWebImageManager *instance;
|
|||
SDWIRelease(cacheURLs);
|
||||
SDWIRelease(downloaderForURL);
|
||||
SDWIRelease(failedURLs);
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
[super dealloc];
|
||||
#endif
|
||||
SDWISuperDealoc;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -106,10 +106,7 @@ static SDWebImagePrefetcher *instance;
|
|||
- (void)dealloc
|
||||
{
|
||||
self.prefetchURLs = nil;
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
[super dealloc];
|
||||
#endif
|
||||
SDWISuperDealoc;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue