From 5a7e330ef5e013e5df5fe771d3901ff890aa9731 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Thu, 8 Mar 2018 20:41:59 +0000 Subject: Unset timer in XFA scrollbar after stopping it. This fixes a crash that happens after interacting with the scrollbar a few times. Bug: chromium:820210 Change-Id: I458337f21c9322351474a1574ab596c600dcbbbf Reviewed-on: https://pdfium-review.googlesource.com/28290 Commit-Queue: Henrique Nakashima Commit-Queue: dsinclair Reviewed-by: dsinclair --- xfa/fwl/cfwl_scrollbar.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xfa/fwl/cfwl_scrollbar.cpp b/xfa/fwl/cfwl_scrollbar.cpp index 26c367a831..1d22386c83 100644 --- a/xfa/fwl/cfwl_scrollbar.cpp +++ b/xfa/fwl/cfwl_scrollbar.cpp @@ -385,8 +385,11 @@ void CFWL_ScrollBar::OnLButtonDown(const CFX_PointF& point) { } void CFWL_ScrollBar::OnLButtonUp(const CFX_PointF& point) { - if (m_pTimerInfo) + if (m_pTimerInfo) { m_pTimerInfo->StopTimer(); + m_pTimerInfo = nullptr; + } + m_bMouseDown = false; DoMouseUp(0, m_rtMinBtn, m_iMinButtonState, point); DoMouseUp(1, m_rtThumb, m_iThumbButtonState, point); @@ -487,8 +490,10 @@ CFWL_ScrollBar::Timer::Timer(CFWL_ScrollBar* pToolTip) : CFWL_Timer(pToolTip) {} void CFWL_ScrollBar::Timer::Run(CFWL_TimerInfo* pTimerInfo) { CFWL_ScrollBar* pScrollBar = static_cast(m_pWidget.Get()); - if (pScrollBar->m_pTimerInfo) + if (pScrollBar->m_pTimerInfo) { pScrollBar->m_pTimerInfo->StopTimer(); + pScrollBar->m_pTimerInfo = nullptr; + } if (!pScrollBar->SendEvent()) pScrollBar->m_pTimerInfo = StartTimer(0, true); -- cgit v1.2.3