summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_mgr.cpp
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2016-01-20 08:04:47 +0800
committerJun Fang <jun_fang@foxitsoftware.com>2016-01-20 08:04:47 +0800
commit752395430376536487352815e6107c32dac7d69e (patch)
tree46c00fbf689d893f32850bae1120f41239f19767 /fpdfsdk/src/fsdk_mgr.cpp
parent4a2aa1a90d89b88036b0bff432ffefa183ea80d0 (diff)
downloadpdfium-752395430376536487352815e6107c32dac7d69e.tar.xz
Fix crashing in CPDFXFA_Document::GetPage()
BUG=pdfium:332 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1539193003 .
Diffstat (limited to 'fpdfsdk/src/fsdk_mgr.cpp')
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 6d656a0c14..56f8204ce9 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -1118,6 +1118,18 @@ void CPDFSDK_PageView::LoadFXAnnots() {
SetLock(FALSE);
}
+void CPDFSDK_PageView::ClearFXAnnots() {
+ SetLock(TRUE);
+ if (m_pSDKDoc && 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);