diff options
Diffstat (limited to 'fpdfsdk/cpdfsdk_document.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_document.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fpdfsdk/cpdfsdk_document.cpp b/fpdfsdk/cpdfsdk_document.cpp index 544c1e6e19..a0febafd48 100644 --- a/fpdfsdk/cpdfsdk_document.cpp +++ b/fpdfsdk/cpdfsdk_document.cpp @@ -39,14 +39,17 @@ CPDFSDK_Document::CPDFSDK_Document(UnderlyingDocumentType* pDoc, CPDFSDK_Document::~CPDFSDK_Document() { m_bBeingDestroyed = TRUE; + ClearAllFocusedAnnots(); + for (auto& it : m_pageMap) + delete it.second; + m_pageMap.clear(); +} + +void CPDFSDK_Document::ClearAllFocusedAnnots() { for (auto& it : m_pageMap) { if (it.second->IsValidSDKAnnot(GetFocusAnnot())) KillFocusAnnot(0); } - - for (auto& it : m_pageMap) - delete it.second; - m_pageMap.clear(); } CPDFSDK_PageView* CPDFSDK_Document::GetPageView( |