From 59321513593af496f22439a3305bb95d31330091 Mon Sep 17 00:00:00 2001 From: Sven Weidauer Date: Thu, 20 Jan 2011 11:38:10 +0000 Subject: Releasing objects in dealloc svn path=/trunk/netsurf/; revision=11413 --- cocoa/BrowserView.m | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'cocoa/BrowserView.m') diff --git a/cocoa/BrowserView.m b/cocoa/BrowserView.m index b90879086..23a4c562c 100644 --- a/cocoa/BrowserView.m +++ b/cocoa/BrowserView.m @@ -36,6 +36,21 @@ static const CGFloat CaretWidth = 1.0; static const NSTimeInterval CaretBlinkTime = 0.8; +- (void) dealloc; +{ + [self setCaretTimer: nil]; + [super dealloc]; +} + +- (void) setCaretTimer: (NSTimer *)newTimer; +{ + if (newTimer != caretTimer) { + [caretTimer invalidate]; + [caretTimer release]; + caretTimer = [newTimer retain]; + } +} + static inline NSRect cocoa_get_caret_rect( BrowserView *view ) { NSRect caretRect = { @@ -51,7 +66,6 @@ static inline NSRect cocoa_get_caret_rect( BrowserView *view ) hasCaret = NO; [self setNeedsDisplayInRect: cocoa_get_caret_rect( self )]; - [caretTimer invalidate]; [self setCaretTimer: nil]; } -- cgit v1.2.3