summaryrefslogtreecommitdiff
path: root/core/src/fxge/agg
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-06-19 14:51:10 -0700
committerLei Zhang <thestig@chromium.org>2015-06-19 14:51:10 -0700
commitcfac954abcab7caf47d3fa3d641c553cba998271 (patch)
tree4cd546a2377e973fec54b75c1002c8c0ff321e8f /core/src/fxge/agg
parentdf558514bf5cb5750d5a7000a843f45f4170d5a4 (diff)
downloadpdfium-cfac954abcab7caf47d3fa3d641c553cba998271.tar.xz
Cleanup: Do not check pointers before deleting them.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1192743004.
Diffstat (limited to 'core/src/fxge/agg')
-rw-r--r--core/src/fxge/agg/src/fx_agg_driver.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/core/src/fxge/agg/src/fx_agg_driver.cpp b/core/src/fxge/agg/src/fx_agg_driver.cpp
index 18a1fa43b5..8e7846abd4 100644
--- a/core/src/fxge/agg/src/fx_agg_driver.cpp
+++ b/core/src/fxge/agg/src/fx_agg_driver.cpp
@@ -205,9 +205,7 @@ CFX_AggDeviceDriver::CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits,
}
CFX_AggDeviceDriver::~CFX_AggDeviceDriver()
{
- if (m_pClipRgn) {
- delete m_pClipRgn;
- }
+ delete m_pClipRgn;
for (int i = 0; i < m_StateStack.GetSize(); i ++)
if (m_StateStack[i]) {
delete (CFX_ClipRgn*)m_StateStack[i];
@@ -274,17 +272,13 @@ void CFX_AggDeviceDriver::SaveState()
void CFX_AggDeviceDriver::RestoreState(FX_BOOL bKeepSaved)
{
if (m_StateStack.GetSize() == 0) {
- if (m_pClipRgn) {
- delete m_pClipRgn;
- m_pClipRgn = NULL;
- }
- return;
- }
- CFX_ClipRgn* pSavedClip = (CFX_ClipRgn*)m_StateStack[m_StateStack.GetSize() - 1];
- if (m_pClipRgn) {
delete m_pClipRgn;
m_pClipRgn = NULL;
+ return;
}
+ CFX_ClipRgn* pSavedClip = (CFX_ClipRgn*)m_StateStack[m_StateStack.GetSize() - 1];
+ delete m_pClipRgn;
+ m_pClipRgn = NULL;
if (bKeepSaved) {
if (pSavedClip) {
m_pClipRgn = new CFX_ClipRgn(*pSavedClip);
@@ -1604,7 +1598,7 @@ FX_BOOL CFX_FxgeDevice::Create(int width, int height, FXDIB_Format format, int d
}
CFX_FxgeDevice::~CFX_FxgeDevice()
{
- if (m_bOwnedBitmap && GetBitmap()) {
+ if (m_bOwnedBitmap) {
delete GetBitmap();
}
}