Transition to ARC

This commit is contained in:
Dmitry Serov
2017-07-29 23:14:22 +07:00
parent 6c30359beb
commit 845dfe6017
63 changed files with 335 additions and 767 deletions

View File

@@ -71,12 +71,6 @@ BlocklistDownloader * fBLDownloader = nil;
}
}
- (void) dealloc
{
[fDownload release];
[fDestination release];
[super dealloc];
}
- (void) cancelDownload
{
@@ -87,7 +81,6 @@ BlocklistDownloader * fBLDownloader = nil;
[[BlocklistScheduler scheduler] updateSchedule];
fBLDownloader = nil;
[self release];
}
//using the actual filename is the best bet
@@ -98,8 +91,7 @@ BlocklistDownloader * fBLDownloader = nil;
- (void) download: (NSURLDownload *) download didCreateDestination: (NSString *) path
{
[fDestination release];
fDestination = [path retain];
fDestination = path;
}
- (void) download: (NSURLDownload *) download didReceiveResponse: (NSURLResponse *) response
@@ -126,7 +118,6 @@ BlocklistDownloader * fBLDownloader = nil;
[[BlocklistScheduler scheduler] updateSchedule];
fBLDownloader = nil;
[self release];
}
- (void) downloadDidFinish: (NSURLDownload *) download
@@ -161,7 +152,6 @@ BlocklistDownloader * fBLDownloader = nil;
[[NSNotificationCenter defaultCenter] postNotificationName: @"BlocklistUpdated" object: nil];
fBLDownloader = nil;
[self release];
});
});
}
@@ -223,7 +213,6 @@ BlocklistDownloader * fBLDownloader = nil;
{
success = NO;
}
[unzip release];
if (success) {
//Now find out what file we actually extracted; don't just assume it matches the zipfile's name
@@ -244,19 +233,17 @@ BlocklistDownloader * fBLDownloader = nil;
[zipinfo launch];
[zipinfo waitUntilExit];
NSString * actualFilename = [[[NSString alloc] initWithData: [zipinfoOutput readDataToEndOfFile]
encoding: NSUTF8StringEncoding] autorelease];
NSString * actualFilename = [[NSString alloc] initWithData: [zipinfoOutput readDataToEndOfFile]
encoding: NSUTF8StringEncoding];
actualFilename = [actualFilename stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString * newBlocklistPath = [workingDirectory stringByAppendingPathComponent: actualFilename];
//Finally, delete the ZIP file; we're done with it, and we'll return the unzipped blocklist
[[NSFileManager defaultManager] removeItemAtPath: fDestination error: NULL];
[fDestination release];
fDestination = [newBlocklistPath retain];
fDestination = newBlocklistPath;
}
@catch(id exc) {}
[zipinfo release];
}
}
}