mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Explicit timer invalidation
This commit is contained in:
@@ -326,9 +326,9 @@ OAK_DEBUG_VAR(Find_FolderSearch);
|
||||
|
||||
if(self.scannerProbeTimer)
|
||||
{
|
||||
OakTimer* probeTimer = [[self.scannerProbeTimer retain] autorelease];
|
||||
[self.scannerProbeTimer invalidate];
|
||||
self.scannerProbeTimer = nil;
|
||||
[probeTimer fire];
|
||||
[self updateMatches:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:FFDocumentSearchDidFinishNotification object:self];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ PUBLIC @interface OakTimer : NSObject
|
||||
+ (id)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds target:(id)target selector:(SEL)aSelector repeats:(BOOL)repeats;
|
||||
+ (id)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds target:(id)target selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats;
|
||||
@property (nonatomic, retain) id userInfo;
|
||||
- (void)fire;
|
||||
- (void)invalidate;
|
||||
@end
|
||||
|
||||
@@ -57,7 +57,13 @@ OAK_DEBUG_VAR(OakTimer);
|
||||
- (void)dealloc
|
||||
{
|
||||
D(DBF_OakTimer, bug("\n"););
|
||||
[self invalidate];
|
||||
}
|
||||
|
||||
- (void)invalidate
|
||||
{
|
||||
[self.timer invalidate];
|
||||
self.timer = nil;
|
||||
}
|
||||
|
||||
- (void)fire
|
||||
@@ -73,6 +79,6 @@ OAK_DEBUG_VAR(OakTimer);
|
||||
D(DBF_OakTimer, bug("target: %p, action: %s\n", self.target, sel_getName(selector)););
|
||||
if(self.target)
|
||||
[self fire];
|
||||
else [self.timer invalidate];
|
||||
else [self invalidate];
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user