diff options
author | tsepez <tsepez@chromium.org> | 2016-05-16 14:10:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-16 14:10:22 -0700 |
commit | 44d83f3f0b90f4c53ca42115d4f1ed614b25c3a7 (patch) | |
tree | f54ee0cd640a9480341844dac86a4178892c94e5 /fpdfsdk/fsdk_mgr.cpp | |
parent | 3cc01f2ba255f4b7584668ee2b8e5ed97792c26d (diff) | |
download | pdfium-44d83f3f0b90f4c53ca42115d4f1ed614b25c3a7.tar.xz |
Use CFX_RetainPtr<> to refcount CPDFXFA_Page
Review-Url: https://codereview.chromium.org/1984693002
Diffstat (limited to 'fpdfsdk/fsdk_mgr.cpp')
-rw-r--r-- | fpdfsdk/fsdk_mgr.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp index 2d641783f9..95a08a740c 100644 --- a/fpdfsdk/fsdk_mgr.cpp +++ b/fpdfsdk/fsdk_mgr.cpp @@ -12,6 +12,7 @@ #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" +#include "core/fxcrt/include/cfx_retain_ptr.h" #include "fpdfsdk/formfiller/cffl_formfiller.h" #include "fpdfsdk/include/fsdk_define.h" #include "fpdfsdk/javascript/ijs_runtime.h" @@ -902,7 +903,7 @@ void CPDFSDK_PageView::LoadFXAnnots() { SetLock(TRUE); #ifdef PDF_ENABLE_XFA - m_page->AddRef(); + CFX_RetainPtr<CPDFXFA_Page> protector(m_page); if (m_pSDKDoc->GetXFADocument()->GetDocType() == DOCTYPE_DYNAMIC_XFA) { CXFA_FFPageView* pageView = m_page->GetXFAPageView(); std::unique_ptr<IXFA_WidgetIterator> pWidgetHander( @@ -911,7 +912,6 @@ void CPDFSDK_PageView::LoadFXAnnots() { XFA_WIDGETFILTER_Viewable | XFA_WIDGETFILTER_AllType)); if (!pWidgetHander) { - m_page->Release(); SetLock(FALSE); return; } @@ -944,7 +944,6 @@ void CPDFSDK_PageView::LoadFXAnnots() { pAnnotHandlerMgr->Annot_OnLoad(pAnnot); } } - m_page->Release(); #else // PDF_ENABLE_XFA for (size_t i = 0; i < nCount; ++i) { CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i); |