Invalidate insertion point timer in dealloc

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38982 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2015-09-11 15:46:22 +00:00
parent e8f9310fd1
commit 3653dd62ec

View file

@ -141,6 +141,8 @@ Interface for a bunch of internal methods that need to be cleaned up.
* Used to implement the blinking insertion point
*/
- (void) _blink: (NSTimer *)t;
- (void) _stopInsertionTimer;
- (void) _startInsertionTimer;
/*
* these NSLayoutManager- like method is here only informally
@ -1118,6 +1120,7 @@ that makes decoding and encoding compatible with the old code.
name: NSTextDidChangeNotification
object: self];
[_textCheckingTimer invalidate];
[self _stopInsertionTimer];
[[NSRunLoop currentRunLoop] cancelPerformSelector: @selector(_updateState:)
target: self
@ -4237,32 +4240,6 @@ Figure out how the additional layout stuff is supposed to work.
return nil;
}
- (void) _stopInsertionTimer
{
if (_insertionPointTimer != nil)
{
[_insertionPointTimer invalidate];
DESTROY(_insertionPointTimer);
}
}
- (void) _startInsertionTimer
{
if (_insertionPointTimer != nil)
{
NSWarnMLog(@"Starting insertion timer with existing one running");
[self _stopInsertionTimer];
}
_insertionPointTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5
target: self
selector: @selector(_blink:)
userInfo: nil
repeats: YES];
[[NSRunLoop currentRunLoop] addTimer: _insertionPointTimer
forMode: NSModalPanelRunLoopMode];
RETAIN(_insertionPointTimer);
}
- (void) updateInsertionPointStateAndRestartTimer: (BOOL)restartFlag
{
NSRect new;
@ -6257,6 +6234,32 @@ or add guards
[self displayIfNeeded];
}
- (void) _stopInsertionTimer
{
if (_insertionPointTimer != nil)
{
[_insertionPointTimer invalidate];
DESTROY(_insertionPointTimer);
}
}
- (void) _startInsertionTimer
{
if (_insertionPointTimer != nil)
{
NSWarnMLog(@"Starting insertion timer with existing one running");
[self _stopInsertionTimer];
}
_insertionPointTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5
target: self
selector: @selector(_blink:)
userInfo: nil
repeats: YES];
[[NSRunLoop currentRunLoop] addTimer: _insertionPointTimer
forMode: NSModalPanelRunLoopMode];
RETAIN(_insertionPointTimer);
}
- (NSRect) rectForCharacterRange: (NSRange)aRange
{
NSRange glyphRange;