From d99d5e3a34e18a771d62d449f379cb65bb54eee1 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 17 May 2018 17:44:32 +0000 Subject: Add comment about cleaning binding nodes The reason for calling ReleaseBindingNodes() has changed but the code comment hadn't. This CL updates the code comment to make it clearer why this release has to happen. Change-Id: I0c08c7580ef7c8508cd4db7b8930d5f2cd595b1b Reviewed-on: https://pdfium-review.googlesource.com/32690 Commit-Queue: dsinclair Reviewed-by: Henrique Nakashima --- xfa/fxfa/parser/cxfa_document.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp index 4ed337019b..5c4b55776a 100644 --- a/xfa/fxfa/parser/cxfa_document.cpp +++ b/xfa/fxfa/parser/cxfa_document.cpp @@ -1283,7 +1283,9 @@ CXFA_Document::CXFA_Document(CXFA_FFNotify* notify) m_dwDocFlags(0) {} CXFA_Document::~CXFA_Document() { - // Remove all the bindings before freeing the node as the ownership is wonky. + // The destruction order of the nodes is not known because they're stored in a + // list in the document. Therefore. the binding nodes must be released before + // freeing the nodes to avoid dangling UnownedPtrs. if (m_pRootNode) m_pRootNode->ReleaseBindingNodes(); } -- cgit v1.2.3