summaryrefslogtreecommitdiff
path: root/core/src/fxge/agg
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-06-19 17:26:17 -0700
committerLei Zhang <thestig@chromium.org>2015-06-19 17:26:17 -0700
commit6d8b1c2c7b1cbada20109f70ae971a4192330bb5 (patch)
treee755b7cb2624622cba606134493d25fb7f1ce6c8 /core/src/fxge/agg
parent9883a7da2d4f31910073c03e703d5b97a45d9254 (diff)
downloadpdfium-6d8b1c2c7b1cbada20109f70ae971a4192330bb5.tar.xz
Merge to XFA: Cleanup: Do not check pointers before deleting them.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1192743004. (cherry picked from commit cfac954abcab7caf47d3fa3d641c553cba998271) Review URL: https://codereview.chromium.org/1196783003.
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 49556bd10b..cb01893d5b 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];
@@ -277,17 +275,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 = FX_NEW CFX_ClipRgn(*pSavedClip);
@@ -1625,7 +1619,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();
}
}