Author: mlytwyn
Date: Fri Sep 11 17:46:22 2015
New Revision: 38982
URL: http://svn.gna.org/viewcvs/gnustep?rev=38982&view=rev
Log:
Invalidate insertion point timer in dealloc
Modified:
libs/gui/branches/gnustep_testplant_branch/Source/NSTextView.m
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSTextView.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSTextView.m?rev=38982&r1=38981&r2=38982&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSTextView.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSTextView.m Fri Sep
11 17:46:22 2015
@@ -141,6 +141,8 @@
* 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 @@
name: NSTextDidChangeNotification
object: self];
[_textCheckingTimer invalidate];
+ [self _stopInsertionTimer];
[[NSRunLoop currentRunLoop] cancelPerformSelector: @selector(_updateState:)
target: self
@@ -4235,32 +4238,6 @@
}
END_FOR_IN(_tracking_rects)
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
@@ -6257,6 +6234,32 @@
[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;
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs