summaryrefslogtreecommitdiffstats
path: root/WebCore/page
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-05-06 12:50:00 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-05-06 12:50:00 -0700
commit5c5475b0621577b1ac7e2bdb3870e3e2253d25c6 (patch)
tree626a25a49100443876dc54516d7d186c7efa8962 /WebCore/page
parent1cc2f5523913bd14a01c0c85710dcd6f0d7b5bb8 (diff)
parentbf13d116b8b9dbefaf2a09542aaad63f85cc16d4 (diff)
downloadexternal_webkit-5c5475b0621577b1ac7e2bdb3870e3e2253d25c6.zip
external_webkit-5c5475b0621577b1ac7e2bdb3870e3e2253d25c6.tar.gz
external_webkit-5c5475b0621577b1ac7e2bdb3870e3e2253d25c6.tar.bz2
am bf13d116: am ec366141: am 7f034a17: Fix a ref counting bug in touch event handling. The RefPtr returned from m_originatingTouchPointTargets.take() was only in scope for the duration of the else block but we saved the raw pointer it wrapped. When the else block ende
Diffstat (limited to 'WebCore/page')
-rw-r--r--WebCore/page/EventHandler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index fa771f0..a950407 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -2602,21 +2602,21 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
// Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap.
unsigned touchPointTargetKey = point.id() + 1;
- EventTarget* touchTarget = 0;
+ RefPtr<EventTarget> touchTarget;
if (point.state() == PlatformTouchPoint::TouchPressed) {
m_originatingTouchPointTargets.set(touchPointTargetKey, target);
touchTarget = target;
} else if (point.state() == PlatformTouchPoint::TouchReleased || point.state() == PlatformTouchPoint::TouchCancelled) {
// The target should be the original target for this touch, so get it from the hashmap. As it's a release or cancel
// we also remove it from the map.
- touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey).get();
+ touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey);
} else
- touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey).get();
+ touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey);
- if (!touchTarget)
+ if (!touchTarget.get())
continue;
- RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget, point.id(),
+ RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget.get(), point.id(),
point.screenPos().x(), point.screenPos().y(),
adjustedPageX, adjustedPageY);