summaryrefslogtreecommitdiff
path: root/xfa/src/fgas
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2016-01-11 19:08:21 -0800
committerJun Fang <jun_fang@foxitsoftware.com>2016-01-11 19:08:21 -0800
commitf3c9cf66d6a850b8225bc161722bed8aed440a2f (patch)
treebc3789329155da2eca26809f61ffe30d6c7f394c /xfa/src/fgas
parent65ac873de9164c01af2579a773344c4bca7254d7 (diff)
downloadpdfium-f3c9cf66d6a850b8225bc161722bed8aed440a2f.tar.xz
XFA: Fix memory leakage on Linux
BUG=pdfium:348 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1579503002 .
Diffstat (limited to 'xfa/src/fgas')
-rw-r--r--xfa/src/fgas/include/fx_utl.h1
-rw-r--r--xfa/src/fgas/src/crt/fx_utils.cpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/xfa/src/fgas/include/fx_utl.h b/xfa/src/fgas/include/fx_utl.h
index c58d5a1be6..f65aa994ea 100644
--- a/xfa/src/fgas/include/fx_utl.h
+++ b/xfa/src/fgas/include/fx_utl.h
@@ -46,6 +46,7 @@ class CFX_ThreadLock {
class CFX_BaseArray : public CFX_Target {
protected:
CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize);
+ ~CFX_BaseArray();
int32_t GetSize() const;
int32_t GetBlockSize() const;
uint8_t* AddSpaceTo(int32_t index);
diff --git a/xfa/src/fgas/src/crt/fx_utils.cpp b/xfa/src/fgas/src/crt/fx_utils.cpp
index 7cc4de7022..e8be0d8d5f 100644
--- a/xfa/src/fgas/src/crt/fx_utils.cpp
+++ b/xfa/src/fgas/src/crt/fx_utils.cpp
@@ -36,6 +36,10 @@ CFX_BaseArray::CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize) {
FXSYS_assert(iGrowSize > 0 && iBlockSize > 0);
m_pData = new FX_BASEARRAYDATA(iGrowSize, iBlockSize);
}
+CFX_BaseArray::~CFX_BaseArray() {
+ RemoveAll();
+ delete m_pData;
+}
int32_t CFX_BaseArray::GetSize() const {
return m_pData->iBlockCount;
}