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

Unified Diff: xfa/fxfa/app/xfa_ffdoc.cpp

Issue 1980223002: Revert of Replace Release() { delete this; } in fde_xml_imp.h (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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 | « xfa/fde/xml/fde_xml_imp.cpp ('k') | xfa/fxfa/parser/xfa_document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_ffdoc.cpp
diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp
index 77c3b251a250d79ad5541b7fc80a2a34bfbc39e2..f33e4e0585868226f5f796b330255a3021a6d06d 100644
--- a/xfa/fxfa/app/xfa_ffdoc.cpp
+++ b/xfa/fxfa/app/xfa_ffdoc.cpp
@@ -7,7 +7,6 @@
#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"
@@ -146,11 +145,10 @@
if (!OpenDoc(pPDFDocument)) {
return XFA_PARSESTATUS_SyntaxErr;
}
- std::unique_ptr<IXFA_Parser> pParser(
- IXFA_Parser::Create(m_pDocument, TRUE));
- if (!pParser)
- return XFA_PARSESTATUS_SyntaxErr;
-
+ 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) {
@@ -162,6 +160,8 @@
} else {
iStatus = XFA_PARSESTATUS_StatusErr;
}
+ pParser->Release();
+ pParser = NULL;
}
return iStatus;
}
@@ -265,7 +265,7 @@
m_TypeToDocViewMap.clear();
if (m_pDocument) {
- m_pDocument->DestroyParser();
+ m_pDocument->GetParser()->Release();
m_pDocument = nullptr;
}
« no previous file with comments | « xfa/fde/xml/fde_xml_imp.cpp ('k') | xfa/fxfa/parser/xfa_document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698