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

Unified Diff: xfa/fxfa/parser/xfa_parser_imp.cpp

Issue 1981003002: Replace Release() { delete this; } in fde_xml_imp.h (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Revert accident with editor. 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/fxfa/parser/xfa_parser_imp.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_parser_imp.cpp
diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp
index 01ea1d6fae731d6165fd0f4c10b2cc6f2c9ff5a3..bb4ba864d5641d67552e2f096a5d4baa6cfe684d 100644
--- a/xfa/fxfa/parser/xfa_parser_imp.cpp
+++ b/xfa/fxfa/parser/xfa_parser_imp.cpp
@@ -680,10 +680,9 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data(
CXFA_Node* pNode =
m_pFactory->CreateNode(XFA_XDPPACKET_Datasets, XFA_ELEMENT_DataGroup);
if (!pNode) {
- if (pDataXMLNode != pXMLDocumentNode) {
- pDataXMLNode->Release();
- }
- return NULL;
+ if (pDataXMLNode != pXMLDocumentNode)
+ delete pDataXMLNode;
+ return nullptr;
}
CFX_WideString wsLocalName;
static_cast<CFDE_XMLElement*>(pDataXMLNode)->GetLocalTagName(wsLocalName);
@@ -1335,13 +1334,11 @@ void CXFA_SimpleParser::ParseInstruction(CXFA_Node* pXFANode,
}
}
void CXFA_SimpleParser::CloseParser() {
- if (m_pXMLDoc) {
- m_pXMLDoc->Release();
- m_pXMLDoc = NULL;
- }
+ delete m_pXMLDoc;
+ m_pXMLDoc = nullptr;
if (m_pStream) {
m_pStream->Release();
- m_pStream = NULL;
+ m_pStream = nullptr;
}
}
@@ -1410,17 +1407,16 @@ CXFA_XMLParser::CXFA_XMLParser(CFDE_XMLNode* pRoot, IFX_Stream* pStream)
m_syntaxParserResult(FDE_XmlSyntaxResult::None) {
ASSERT(m_pParent && m_pStream);
m_NodeStack.Push(m_pParent);
- m_pParser = new CFDE_XMLSyntaxParser;
+ m_pParser.reset(new CFDE_XMLSyntaxParser);
m_pParser->Init(m_pStream, 32 * 1024, 1024 * 1024);
}
+
CXFA_XMLParser::~CXFA_XMLParser() {
- if (m_pParser) {
- m_pParser->Release();
- }
m_NodeStack.RemoveAll();
m_ws1.clear();
m_ws2.clear();
}
+
int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) {
if (m_syntaxParserResult == FDE_XmlSyntaxResult::Error)
return -1;
« no previous file with comments | « xfa/fxfa/parser/xfa_parser_imp.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698