diff options
author | Lei Zhang <thestig@chromium.org> | 2015-08-14 22:22:13 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-08-14 22:22:13 -0700 |
commit | da180e9fdd4385df024cc18046f62ca47bc74d74 (patch) | |
tree | 931e0e64ac2cbc82e3718e43418ee6bd676da4a5 /core/src/fxge/ge | |
parent | 2b1a2d528469cda4e9f3e36d3c7a649e0d476480 (diff) | |
download | pdfium-da180e9fdd4385df024cc18046f62ca47bc74d74.tar.xz |
Merge to XFA: Don't bother checking pointers before delete[] and FX_Free().
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1297713003 .
(cherry picked from commit cb62e7657b3a9a04142028a4e6614029a08e894b)
Review URL: https://codereview.chromium.org/1287053005 .
Diffstat (limited to 'core/src/fxge/ge')
-rw-r--r-- | core/src/fxge/ge/fx_ge_font.cpp | 12 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_fontmap.cpp | 4 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_path.cpp | 25 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_ps.cpp | 4 |
4 files changed, 12 insertions, 33 deletions
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp index d428494913..63e9b52954 100644 --- a/core/src/fxge/ge/fx_ge_font.cpp +++ b/core/src/fxge/ge/fx_ge_font.cpp @@ -77,14 +77,10 @@ CFX_Font::~CFX_Font() { CFX_GEModule::Get()->GetFontMgr()->ReleaseFace(m_Face); } } - if (m_pOwnedStream) { - FX_Free(m_pOwnedStream); - m_pOwnedStream = NULL; - } - if (m_pGsubData) { - FX_Free(m_pGsubData); - m_pGsubData = NULL; - } + FX_Free(m_pOwnedStream); + m_pOwnedStream = NULL; + FX_Free(m_pGsubData); + m_pGsubData = NULL; #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ ReleasePlatformResource(); #endif diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index eefeb5d618..f755b69072 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -33,9 +33,7 @@ CTTFontDesc::~CTTFontDesc() { FXFT_Done_Face(m_TTCFace.m_pFaces[i]); } } - if (m_pFontData) { - FX_Free(m_pFontData); - } + FX_Free(m_pFontData); } int32_t CTTFontDesc::ReleaseFace(FXFT_Face face) { if (m_Type == 1) { diff --git a/core/src/fxge/ge/fx_ge_path.cpp b/core/src/fxge/ge/fx_ge_path.cpp index b50c271c20..9acbcabfbf 100644 --- a/core/src/fxge/ge/fx_ge_path.cpp +++ b/core/src/fxge/ge/fx_ge_path.cpp @@ -117,17 +117,12 @@ CFX_PathData::CFX_PathData() { m_pPoints = NULL; } CFX_PathData::~CFX_PathData() { - if (m_pPoints) { - FX_Free(m_pPoints); - } + FX_Free(m_pPoints); } void CFX_PathData::SetPointCount(int nPoints) { m_PointCount = nPoints; if (m_AllocCount < nPoints) { - if (m_pPoints) { - FX_Free(m_pPoints); - m_pPoints = NULL; - } + FX_Free(m_pPoints); m_pPoints = FX_Alloc(FX_PATHPOINT, nPoints); m_AllocCount = nPoints; } @@ -138,9 +133,7 @@ void CFX_PathData::AllocPointCount(int nPoints) { if (m_PointCount) { FXSYS_memcpy(pNewBuf, m_pPoints, m_PointCount * sizeof(FX_PATHPOINT)); } - if (m_pPoints) { - FX_Free(m_pPoints); - } + FX_Free(m_pPoints); m_pPoints = pNewBuf; m_AllocCount = nPoints; } @@ -640,9 +633,7 @@ CFX_GraphStateData::CFX_GraphStateData(const CFX_GraphStateData& src) { void CFX_GraphStateData::Copy(const CFX_GraphStateData& src) { m_LineCap = src.m_LineCap; m_DashCount = src.m_DashCount; - if (m_DashArray) { - FX_Free(m_DashArray); - } + FX_Free(m_DashArray); m_DashArray = NULL; m_DashPhase = src.m_DashPhase; m_LineJoin = src.m_LineJoin; @@ -654,14 +645,10 @@ void CFX_GraphStateData::Copy(const CFX_GraphStateData& src) { } } CFX_GraphStateData::~CFX_GraphStateData() { - if (m_DashArray) { - FX_Free(m_DashArray); - } + FX_Free(m_DashArray); } void CFX_GraphStateData::SetDashCount(int count) { - if (m_DashArray) { - FX_Free(m_DashArray); - } + FX_Free(m_DashArray); m_DashArray = NULL; m_DashCount = count; if (count == 0) { diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp index 5a97d5b18b..34dbde2b2d 100644 --- a/core/src/fxge/ge/fx_ge_ps.cpp +++ b/core/src/fxge/ge/fx_ge_ps.cpp @@ -322,9 +322,7 @@ static void PSCompressData(int PSLevel, output_size = dest_size; } else { filter = NULL; - if (dest_buf) { - FX_Free(dest_buf); - } + FX_Free(dest_buf); } } FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, |