diff options
author | weili <weili@chromium.org> | 2016-08-09 10:33:10 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-09 10:33:10 -0700 |
commit | 16fccc51456dbab7e392c3952cc367723f9694f6 (patch) | |
tree | 0bd44bec6b81213db9d1dc487237164cdcaa43a4 /xfa/fxfa/fm2js/xfa_expression.cpp | |
parent | af7ab33c73f58f18d0db0c90d93fa0aab0bc83f3 (diff) | |
download | pdfium-16fccc51456dbab7e392c3952cc367723f9694f6.tar.xz |
Use smart pointers for class owned pointers
For classes under xfa/fxfa/fm2js, and xfa/fxgraphics, use smart
pointers instead of raw pointer to make memory management easier.
Also fix some styling issues along the changes.
BUG=pdfium:518
Review-Url: https://codereview.chromium.org/2222203002
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_expression.cpp')
-rw-r--r-- | xfa/fxfa/fm2js/xfa_expression.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/xfa/fxfa/fm2js/xfa_expression.cpp b/xfa/fxfa/fm2js/xfa_expression.cpp index ad6acafd48..22e627d72d 100644 --- a/xfa/fxfa/fm2js/xfa_expression.cpp +++ b/xfa/fxfa/fm2js/xfa_expression.cpp @@ -32,16 +32,15 @@ CXFA_FMFunctionDefinition::CXFA_FMFunctionDefinition( uint32_t line, FX_BOOL isGlobal, const CFX_WideStringC& wsName, - CFX_WideStringCArray* pArguments, + std::unique_ptr<CFX_WideStringCArray> pArguments, CFX_ArrayTemplate<CXFA_FMExpression*>* pExpressions) : CXFA_FMExpression(line, XFA_FM_EXPTYPE_FUNC), m_wsName(wsName), - m_pArguments(pArguments), + m_pArguments(std::move(pArguments)), m_pExpressions(pExpressions), m_isGlobal(isGlobal) {} CXFA_FMFunctionDefinition::~CXFA_FMFunctionDefinition() { - delete m_pArguments; if (m_pExpressions) { for (int i = 0; i < m_pExpressions->GetSize(); ++i) delete m_pExpressions->GetAt(i); |