summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/xfa_expression.h
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2016-11-23 14:47:35 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-23 14:47:35 -0800
commit4e847e36fe013bcfddf71c79221887a308b9fadb (patch)
tree6a029f6d2d19ba3f8ff919f10f031e1c46867a3f /xfa/fxfa/fm2js/xfa_expression.h
parent9fd0c630ea2225fc544949d88d1bf63acc43112e (diff)
downloadpdfium-4e847e36fe013bcfddf71c79221887a308b9fadb.tar.xz
More unique_ptrs in CXFA_FMParse::ParseForeachExpression and avoid leak
Commit a31098417852bdf13e693a6e0913e0706cf94098 accidentally caused a leak. Replaced pointers with unique_ptr to prevent this from happening. BUG=664891 Review-Url: https://codereview.chromium.org/2528543003
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_expression.h')
-rw-r--r--xfa/fxfa/fm2js/xfa_expression.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/xfa/fxfa/fm2js/xfa_expression.h b/xfa/fxfa/fm2js/xfa_expression.h
index 69337350bf..236b51a6b0 100644
--- a/xfa/fxfa/fm2js/xfa_expression.h
+++ b/xfa/fxfa/fm2js/xfa_expression.h
@@ -8,6 +8,7 @@
#define XFA_FXFA_FM2JS_XFA_EXPRESSION_H_
#include <memory>
+#include <vector>
#include "xfa/fxfa/fm2js/xfa_simpleexpression.h"
@@ -197,7 +198,7 @@ class CXFA_FMForeachExpression : public CXFA_FMLoopExpression {
CXFA_FMForeachExpression(
uint32_t line,
const CFX_WideStringC& wsIdentifier,
- CFX_ArrayTemplate<CXFA_FMSimpleExpression*>* pAccessors,
+ std::vector<std::unique_ptr<CXFA_FMSimpleExpression>>&& pAccessors,
CXFA_FMExpression* pList);
~CXFA_FMForeachExpression() override;
@@ -206,7 +207,7 @@ class CXFA_FMForeachExpression : public CXFA_FMLoopExpression {
private:
CFX_WideStringC m_wsIdentifier;
- CFX_ArrayTemplate<CXFA_FMSimpleExpression*>* m_pAccessors;
+ std::vector<std::unique_ptr<CXFA_FMSimpleExpression>> m_pAccessors;
std::unique_ptr<CXFA_FMExpression> m_pList;
};