summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-05-31 11:34:04 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-31 11:34:04 -0700
commit86fad999ba59b1f8780582cc683b008880aab42e (patch)
treebc63f57e472a4aca6c2316eea4707d0aa415c122 /xfa/fxfa/parser/xfa_script_resolveprocessor.cpp
parent4dce6d4689d464c3a8825a5d6aa790adfc9228ee (diff)
downloadpdfium-86fad999ba59b1f8780582cc683b008880aab42e.tar.xz
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
Diffstat (limited to 'xfa/fxfa/parser/xfa_script_resolveprocessor.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_script_resolveprocessor.cpp11
1 files changed, 5 insertions, 6 deletions
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<CFXJSE_Value> 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);
}
}