From 86fad999ba59b1f8780582cc683b008880aab42e Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 31 May 2016 11:34:04 -0700 Subject: Replace CFXJSE_Value create/destroy with new and delete. In most cases, the destroy calls were removed and the object wrapped in a unique_ptr. Review-Url: https://codereview.chromium.org/2014323003 --- xfa/fxfa/parser/xfa_script_resolveprocessor.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'xfa/fxfa/parser/xfa_script_resolveprocessor.cpp') diff --git a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp index aa2fa87c4a..8471b802cc 100644 --- a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp +++ b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp @@ -709,13 +709,12 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter( for (int32_t i = iFoundCount - 1; i >= 0; i--) { CXFA_Object* node = findNodes[i]; FX_BOOL bRet = FALSE; - CFXJSE_Value* pRetValue = FXJSE_Value_Create(rnd.m_pSC->GetRuntime()); - bRet = pContext->RunScript(eLangType, wsExpression.AsStringC(), pRetValue, - node); - if (!bRet || !FXJSE_Value_ToBoolean(pRetValue)) { + std::unique_ptr pRetValue( + new CFXJSE_Value(rnd.m_pSC->GetRuntime())); + bRet = pContext->RunScript(eLangType, wsExpression.AsStringC(), + pRetValue.get(), node); + if (!bRet || !FXJSE_Value_ToBoolean(pRetValue.get())) findNodes.RemoveAt(i); - } - FXJSE_Value_Release(pRetValue); } } -- cgit v1.2.3