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

Unified Diff: fpdfsdk/src/fsdk_mgr.cpp

Issue 1539193003: Fix crashing in CPDFXFA_Document::GetPage() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years 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
« fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp ('K') | « fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fsdk_mgr.cpp
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 5e847b78e51f7c45314659257b4d43fef4f5efd1..86278b589de6028cfe684a2d5726c049dce18c57 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -1119,6 +1119,18 @@ void CPDFSDK_PageView::LoadFXAnnots() {
SetLock(FALSE);
}
+void CPDFSDK_PageView::ClearFXAnnots() {
+ SetLock(TRUE);
+ if (m_pSDKDoc && GetFocusAnnot())
Lei Zhang 2015/12/21 17:47:59 Why bother calling GetFocusAnnot() ?
+ m_pSDKDoc->SetFocusAnnot(nullptr);
+ m_CaptureWidget = nullptr;
+ for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray)
+ m_pSDKDoc->GetEnv()->GetAnnotHandlerMgr()->ReleaseAnnot(pAnnot);
+ m_fxAnnotArray.clear();
+ m_pAnnotList.reset();
+ SetLock(FALSE);
+}
+
void CPDFSDK_PageView::UpdateRects(CFX_RectArray& rects) {
for (int i = 0; i < rects.GetSize(); i++) {
CPDF_Rect rc = rects.GetAt(i);
« fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp ('K') | « fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698