summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-16 15:42:58 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-16 15:42:58 -0700
commitfa34e805fd03ba81bcfe1148cf96b24fe63b39a0 (patch)
treeeb9ca58d4b4e327da346491f107d9b54925c18e3 /xfa/fxfa/app
parent44d83f3f0b90f4c53ca42115d4f1ed614b25c3a7 (diff)
downloadpdfium-fa34e805fd03ba81bcfe1148cf96b24fe63b39a0.tar.xz
Replace Release() { delete this; } in fde_xml_imp.h
Review-Url: https://codereview.chromium.org/1981003002
Diffstat (limited to 'xfa/fxfa/app')
-rw-r--r--xfa/fxfa/app/xfa_ffdoc.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp
index f33e4e0585..77c3b251a2 100644
--- a/xfa/fxfa/app/xfa_ffdoc.cpp
+++ b/xfa/fxfa/app/xfa_ffdoc.cpp
@@ -7,6 +7,7 @@
#include "xfa/fxfa/include/xfa_ffdoc.h"
#include <algorithm>
+#include <memory>
#include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
@@ -145,10 +146,11 @@ int32_t CXFA_FFDoc::DoLoad(IFX_Pause* pPause) {
if (!OpenDoc(pPDFDocument)) {
return XFA_PARSESTATUS_SyntaxErr;
}
- IXFA_Parser* pParser = IXFA_Parser::Create(m_pDocument, TRUE);
- if (!pParser) {
+ std::unique_ptr<IXFA_Parser> pParser(
+ IXFA_Parser::Create(m_pDocument, TRUE));
+ if (!pParser)
return XFA_PARSESTATUS_SyntaxErr;
- }
+
CXFA_Node* pRootNode = NULL;
if (pParser->StartParse(m_pStream) == XFA_PARSESTATUS_Ready &&
pParser->DoParse(NULL) == XFA_PARSESTATUS_Done) {
@@ -160,8 +162,6 @@ int32_t CXFA_FFDoc::DoLoad(IFX_Pause* pPause) {
} else {
iStatus = XFA_PARSESTATUS_StatusErr;
}
- pParser->Release();
- pParser = NULL;
}
return iStatus;
}
@@ -265,7 +265,7 @@ FX_BOOL CXFA_FFDoc::CloseDoc() {
m_TypeToDocViewMap.clear();
if (m_pDocument) {
- m_pDocument->GetParser()->Release();
+ m_pDocument->DestroyParser();
m_pDocument = nullptr;
}