Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1636)

Unified Diff: core/src/fxge/ge/fx_ge_path.cpp

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxge/ge/fx_ge_fontmap.cpp ('k') | core/src/fxge/ge/fx_ge_ps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/ge/fx_ge_path.cpp
diff --git a/core/src/fxge/ge/fx_ge_path.cpp b/core/src/fxge/ge/fx_ge_path.cpp
index b50c271c20d791797bb5444850dab68d6efcd8c0..9acbcabfbf253478bdbbcd31b20a7d2662461bd6 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) {
« no previous file with comments | « core/src/fxge/ge/fx_ge_fontmap.cpp ('k') | core/src/fxge/ge/fx_ge_ps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698