Fix for <rdar://problem/8953365> CrashTracer: 14
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Feb 2011 22:11:34 +0000 (22:11 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Feb 2011 22:11:34 +0000 (22:11 +0000)
commit555f9360076b12c1481440d9065d6813053d6a23
treed3fac868229dbdbfcd4502bd2d126f0eb3b91532
parent47da82753e059ad9740e49b9d55123e213f468f7
Fix for <rdar://problem/8953365> CrashTracer: 14
crashes in WebProcess at com.apple.WebCore:
-[ScrollKnobAnimation setCurrentProgress:] + 258

Reviewed by Darin Adler.

This crash seems to happen when the animation is running
and a window is closed. If the ScrollAnimator is destroyed,
delegate calls for the animation can still run, so we have
to make sure we inform the delegates when the ScrollAnimator
is gone, and then we have to null-check it before we do
anything with it.

Remove scrollbarPainterDelegate() since it's not used anymore.
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:

Add null-checks for _animator
(-[ScrollbarPartAnimation setCurrentProgress:]):
(-[ScrollbarPartAnimation scrollAnimatorDestroyed]):
(-[ScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]):
(-[ScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]):
(-[ScrollbarPainterDelegate scrollerImp:overlayScrollerStateChangedTo:]):

New function to inform the delegates that the ScrollAnimator
is being destroyed.
(-[ScrollbarPainterDelegate scrollAnimatorDestroyed]):
(WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@77970 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/mac/ScrollAnimatorMac.h
Source/WebCore/platform/mac/ScrollAnimatorMac.mm