Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Unified Diff: fpdfsdk/formfiller/cffl_checkbox.cpp

Issue 2368403002: Watch destruction of widgets around OnAAction() method (Closed)
Patch Set: Pass everywhere Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: fpdfsdk/formfiller/cffl_checkbox.cpp
diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp
index 01f1a2a08c063b4aedc97f5fd7382962f85aeb5a..e34a5e10dabe991345fa4f1c2eda40405678958a 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.cpp
+++ b/fpdfsdk/formfiller/cffl_checkbox.cpp
@@ -47,15 +47,17 @@ FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot,
FX_BOOL bReset = FALSE;
FX_BOOL bExit = FALSE;
- m_pEnv->GetInteractiveFormFiller()->OnButtonUp(m_pWidget, pPageView,
+ CPDFSDK_Annot::ObservedPtr pObserved(m_pWidget);
+ m_pEnv->GetInteractiveFormFiller()->OnButtonUp(pObserved, pPageView,
bReset, bExit, nFlags);
- if (bReset)
+ if (!pObserved) {
+ m_pWidget = nullptr;
return TRUE;
- if (bExit)
+ }
+ if (bReset || bExit)
return TRUE;
CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
-
if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE))
pWnd->SetCheck(!pWnd->IsChecked());

Powered by Google App Engine
This is Rietveld 408576698