properly retain/release nstimers like any other objective-c object

This commit is contained in:
Mitchell Livingston
2012-09-10 02:37:29 +00:00
parent 4382b7c93a
commit 7dd5b57851
8 changed files with 28 additions and 15 deletions

View File

@@ -206,6 +206,7 @@
tr_metaInfoBuilderFree(fInfo);
[fTimer invalidate];
[fTimer release];
[super dealloc];
}
@@ -551,8 +552,7 @@
tr_makeMetaInfo(fInfo, [[fLocation path] UTF8String], trackerInfo, [fTrackers count], [[fCommentView string] UTF8String], [fPrivateCheck state] == NSOnState);
tr_free(trackerInfo);
fTimer = [NSTimer scheduledTimerWithTimeInterval: 0.1 target: self selector: @selector(checkProgress)
userInfo: nil repeats: YES];
fTimer = [[NSTimer scheduledTimerWithTimeInterval: 0.1 target: self selector: @selector(checkProgress) userInfo: nil repeats: YES] retain];
}
- (void) checkProgress
@@ -560,6 +560,7 @@
if (fInfo->isDone)
{
[fTimer invalidate];
[fTimer release];
fTimer = nil;
NSAlert * alert;