From 13aa65a71294cac6e4bdaab73ddd6f4b9fcd8676 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 17 Apr 2018 21:34:18 +0000 Subject: Add ownership to CFX_XMLNode children This CL sets the CFX_XML tree ownership. The pointers set into the tree must be unique_ptrs and the CFX_XMLNode children are set to be either unique_ptrs or UnownedPtrs. Change-Id: Ib0db495c81471e40f5b4533503f7bbe5a784fd77 Reviewed-on: https://pdfium-review.googlesource.com/30711 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- fxjs/xfa/cjx_node.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fxjs/xfa') diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp index 44a5a1a42c..a8a88c9627 100644 --- a/fxjs/xfa/cjx_node.cpp +++ b/fxjs/xfa/cjx_node.cpp @@ -251,7 +251,7 @@ CJS_Return CJX_Node::loadXML(CFX_V8* runtime, while (pXMLChild) { CFX_XMLNode* pXMLSibling = pXMLChild->GetNextSibling(); pXMLNode->RemoveChildNode(pXMLChild); - pFakeXMLRoot->AppendChild(pXMLChild); + pFakeXMLRoot->AppendChild(pdfium::WrapUnique(pXMLChild)); pXMLChild = pXMLSibling; } } else { @@ -259,7 +259,7 @@ CJS_Return CJX_Node::loadXML(CFX_V8* runtime, if (pXMLParent) pXMLParent->RemoveChildNode(pXMLNode); - pFakeXMLRoot->AppendChild(pXMLNode); + pFakeXMLRoot->AppendChild(pdfium::WrapUnique(pXMLNode)); } pParser->ConstructXFANode(pFakeRoot, pFakeXMLRoot.get()); -- cgit v1.2.3