summaryrefslogtreecommitdiff
path: root/fpdfsdk/fsdk_mgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fsdk_mgr.cpp')
-rw-r--r--fpdfsdk/fsdk_mgr.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp
index 423bb8263a..1ff1ca7ca3 100644
--- a/fpdfsdk/fsdk_mgr.cpp
+++ b/fpdfsdk/fsdk_mgr.cpp
@@ -858,6 +858,13 @@ FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) {
pPage->GetDocument()->GetDocType() != DOCTYPE_DYNAMIC_XFA))
return FALSE;
+ if (GetFocusAnnot() == pAnnot)
+ KillFocusAnnot();
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ CPDFSDK_AnnotHandlerMgr* pAnnotHandler = pEnv->GetAnnotHandlerMgr();
+ if (pAnnotHandler)
+ pAnnotHandler->ReleaseAnnot(pAnnot);
+
auto it = std::find(m_fxAnnotArray.begin(), m_fxAnnotArray.end(), pAnnot);
if (it != m_fxAnnotArray.end())
m_fxAnnotArray.erase(it);