summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_textfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/formfiller/cffl_textfield.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_textfield.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp
index 70bc202fbf..d598419c1b 100644
--- a/fpdfsdk/formfiller/cffl_textfield.cpp
+++ b/fpdfsdk/formfiller/cffl_textfield.cpp
@@ -238,14 +238,12 @@ CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView,
SaveState(pPageView);
DestroyPDFWindow(pPageView);
-
- CPWL_Wnd* pRet = nullptr;
-
if (bRestoreValue)
RestoreState(pPageView);
- pRet = GetPDFWindow(pPageView, !bRestoreValue);
- m_pWidget->UpdateField();
- return pRet;
+
+ CPWL_Wnd::ObservedPtr pRet(GetPDFWindow(pPageView, !bRestoreValue));
+ m_pWidget->UpdateField(); // May invoke JS, invalidating pRet.
+ return pRet.Get();
}
#ifdef PDF_ENABLE_XFA