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

Unified Diff: fpdfsdk/cpdfsdk_document.cpp

Issue 2397473006: Remove ownership of CPDFSDK_Document from CPDFXFA_Document (Closed)
Patch Set: Rebase to master Created 4 years, 2 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
« no previous file with comments | « fpdfsdk/cpdfsdk_document.h ('k') | fpdfsdk/cpdfsdk_environment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/cpdfsdk_document.cpp
diff --git a/fpdfsdk/cpdfsdk_document.cpp b/fpdfsdk/cpdfsdk_document.cpp
index 544c1e6e195b8c9dfea914292dede185875999a0..a0febafd484e38968077bc26454f19d494dd5a62 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(
« no previous file with comments | « fpdfsdk/cpdfsdk_document.h ('k') | fpdfsdk/cpdfsdk_environment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698