__unsafe_unretained does not prevent self retain-cycles when not under ARC

This commit is contained in:
Pierre-Olivier Latour
2014-04-09 11:10:45 -07:00
parent 811e45ab26
commit efad06f506
3 changed files with 12 additions and 0 deletions

View File

@@ -561,7 +561,11 @@ static inline xmlNodePtr _XMLChildWithName(xmlNodePtr child, const xmlChar* name
- (instancetype)initWithUploadDirectory:(NSString*)path {
if ((self = [super init])) {
_uploadDirectory = [[path stringByStandardizingPath] copy];
#if __has_feature(objc_arc)
GCDWebDAVServer* __unsafe_unretained server = self;
#else
__block GCDWebDAVServer* server = self;
#endif
// 9.1 PROPFIND method
[self addDefaultHandlerForMethod:@"PROPFIND" requestClass:[GCDWebServerDataRequest class] processBlock:^GCDWebServerResponse *(GCDWebServerRequest* request) {