summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_caret.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl/cfwl_caret.cpp')
-rw-r--r--xfa/fwl/cfwl_caret.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/xfa/fwl/cfwl_caret.cpp b/xfa/fwl/cfwl_caret.cpp
index cd85041d92..03c8ffde68 100644
--- a/xfa/fwl/cfwl_caret.cpp
+++ b/xfa/fwl/cfwl_caret.cpp
@@ -58,17 +58,21 @@ void CFWL_Caret::DrawWidget(CXFA_Graphics* pGraphics,
}
void CFWL_Caret::ShowCaret() {
- if (m_pTimerInfo)
- m_pTimerInfo->StopTimer();
+ if (m_pTimerInfo) {
+ CFWL_TimerInfo* pOldTimerInfo = m_pTimerInfo.Release();
+ pOldTimerInfo->StopTimer();
+ }
+
m_pTimerInfo = m_pTimer->StartTimer(kFrequency, true);
RemoveStates(FWL_WGTSTATE_Invisible);
}
void CFWL_Caret::HideCaret() {
if (m_pTimerInfo) {
- m_pTimerInfo->StopTimer();
- m_pTimerInfo = nullptr;
+ CFWL_TimerInfo* pOldTimerInfo = m_pTimerInfo.Release();
+ pOldTimerInfo->StopTimer();
}
+
SetStates(FWL_WGTSTATE_Invisible);
}