From a548b1d3e2444f256bcbf6c2fa2165798e33ba8d Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Fri, 30 Oct 2015 12:48:49 -0700 Subject: Rip out the KillFocusAnnot call from CPDFSDK_PageView's destructor Previously, blur event actions could potentially touch deleted PageViews as CPDFSDK_Document deletes the PageViews one by one. This also fixes a related issue: CPDFSDK_Document::SetFocusAnnot no longer does anything if the document is being destroyed. Otherwise, it eventually tries to use m_pEnv->GetSDKDocument() at which point has already been set to NULL by FPDFDOC_ExitFormFillEnvironment. R=tsepez@chromium.org, thestig@chromium.org BUG=512445 Review URL: https://codereview.chromium.org/1414353007 . --- fpdfsdk/include/fsdk_mgr.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fpdfsdk/include') diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h index 2c063ed5a8..2cc528265d 100644 --- a/fpdfsdk/include/fsdk_mgr.h +++ b/fpdfsdk/include/fsdk_mgr.h @@ -283,6 +283,7 @@ class CPDFSDK_Document { CPDFDoc_Environment* m_pEnv; CPDF_OCContext* m_pOccontent; FX_BOOL m_bChangeMask; + FX_BOOL m_bBeingDestroyed; }; class CPDFSDK_PageView final { public: @@ -302,6 +303,7 @@ class CPDFSDK_PageView final { FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0) { return m_pSDKDoc->KillFocusAnnot(nFlag); } + void KillFocusAnnotIfNeeded(); FX_BOOL Annot_HasAppearance(CPDF_Annot* pAnnot); CPDFSDK_Annot* AddAnnot(CPDF_Dictionary* pDict); -- cgit v1.2.3