From 1666e21c2fc0ae35247f745b5e5cee261f34f41b Mon Sep 17 00:00:00 2001 From: "pinkerton@chromium.org" Date: Thu, 21 May 2009 16:29:58 +0000 Subject: Turning timer back on, invalidating timer when removing from superview. Still playing with tab_cold perf test. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16609 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/throbber_view.mm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/cocoa/throbber_view.mm b/chrome/browser/cocoa/throbber_view.mm index b6b48c3..b8a517e 100644 --- a/chrome/browser/cocoa/throbber_view.mm +++ b/chrome/browser/cocoa/throbber_view.mm @@ -50,7 +50,6 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows DCHECK(numFrames_); image_.reset([image retain]); -#if 0 // Start a timer for the animation frames. target_.reset([[TimerTarget alloc] initWithThrobber:self]); timer_ = @@ -59,7 +58,6 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows selector:@selector(animate:) userInfo:nil repeats:YES]; -#endif } return self; } @@ -69,6 +67,13 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows [super dealloc]; } +- (void)removeFromSuperview { + [timer_ invalidate]; + timer_ = nil; + + [super removeFromSuperview]; +} + // Called when the TimerTarget gets tickled by our timer. Increment the frame // counter and mark as needing display. - (void)animate { -- cgit v1.1