cancel blocklist download when quitting; cleanup
This commit is contained in:
parent
8cf84293b5
commit
3c997c92a7
|
@ -40,7 +40,9 @@
|
|||
long long fExpectedSize;
|
||||
}
|
||||
|
||||
+ (BlocklistDownloader *) downloader: (tr_handle *) handle;
|
||||
+ (BlocklistDownloader *) downloader: (tr_handle *) handle; //starts download if not already occuring
|
||||
+ (BOOL) isRunning;
|
||||
|
||||
- (void) setViewController: (BlocklistDownloaderViewController *) viewController;
|
||||
|
||||
- (void) cancelDownload;
|
||||
|
|
|
@ -51,6 +51,11 @@ BlocklistDownloader * fDownloader = nil;
|
|||
return fDownloader;
|
||||
}
|
||||
|
||||
+ (BOOL) isRunning
|
||||
{
|
||||
return fDownloader != nil;
|
||||
}
|
||||
|
||||
- (void) setViewController: (BlocklistDownloaderViewController *) viewController
|
||||
{
|
||||
fViewController = viewController;
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#import "ButtonToolbarItem.h"
|
||||
#import "GroupToolbarItem.h"
|
||||
#import "ToolbarSegmentedCell.h"
|
||||
#import "BlocklistDownloader.h"
|
||||
#import "NSApplicationAdditions.h"
|
||||
#import "NSStringAdditions.h"
|
||||
#import "NSMenuAdditions.h"
|
||||
|
@ -559,7 +560,9 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
|||
|
||||
- (void) applicationWillTerminate: (NSNotification *) notification
|
||||
{
|
||||
#warning stop blocklist download
|
||||
//stop blocklist download
|
||||
if ([BlocklistDownloader isRunning])
|
||||
[[BlocklistDownloader downloader: fLib] cancelDownload];
|
||||
|
||||
//stop timers and notification checking
|
||||
[[NSNotificationCenter defaultCenter] removeObserver: self];
|
||||
|
|
Loading…
Reference in New Issue