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

Side by Side Diff: core/src/fxge/agg/src/fx_agg_driver.cpp

Issue 1195363002: Cleanup: Do not check pointers before deleting them, part 2. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../../../include/fxge/fx_ge.h" 7 #include "../../../../include/fxge/fx_ge.h"
8 #include "../../dib/dib_int.h" 8 #include "../../dib/dib_int.h"
9 #include "../../ge/text_int.h" 9 #include "../../ge/text_int.h"
10 #include "../../../../include/fxcodec/fx_codec.h" 10 #include "../../../../include/fxcodec/fx_codec.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 m_bRgbByteOrder = bRgbByteOrder; 200 m_bRgbByteOrder = bRgbByteOrder;
201 m_pOriDevice = pOriDevice; 201 m_pOriDevice = pOriDevice;
202 m_bGroupKnockout = bGroupKnockout; 202 m_bGroupKnockout = bGroupKnockout;
203 m_FillFlags = 0; 203 m_FillFlags = 0;
204 InitPlatform(); 204 InitPlatform();
205 } 205 }
206 CFX_AggDeviceDriver::~CFX_AggDeviceDriver() 206 CFX_AggDeviceDriver::~CFX_AggDeviceDriver()
207 { 207 {
208 delete m_pClipRgn; 208 delete m_pClipRgn;
209 for (int i = 0; i < m_StateStack.GetSize(); i ++) 209 for (int i = 0; i < m_StateStack.GetSize(); i ++)
210 if (m_StateStack[i]) { 210 delete (CFX_ClipRgn*)m_StateStack[i];
211 delete (CFX_ClipRgn*)m_StateStack[i];
212 }
213 DestroyPlatform(); 211 DestroyPlatform();
214 } 212 }
215 #if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ 213 #if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
216 void CFX_AggDeviceDriver::InitPlatform() 214 void CFX_AggDeviceDriver::InitPlatform()
217 { 215 {
218 } 216 }
219 void CFX_AggDeviceDriver::DestroyPlatform() 217 void CFX_AggDeviceDriver::DestroyPlatform()
220 { 218 {
221 } 219 }
222 FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pC harPos, CFX_Font* pFont, 220 FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pC harPos, CFX_Font* pFont,
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bi ts, FALSE, pOriDevice, FALSE); 1593 IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bi ts, FALSE, pOriDevice, FALSE);
1596 SetDeviceDriver(pDriver); 1594 SetDeviceDriver(pDriver);
1597 return TRUE; 1595 return TRUE;
1598 } 1596 }
1599 CFX_FxgeDevice::~CFX_FxgeDevice() 1597 CFX_FxgeDevice::~CFX_FxgeDevice()
1600 { 1598 {
1601 if (m_bOwnedBitmap) { 1599 if (m_bOwnedBitmap) {
1602 delete GetBitmap(); 1600 delete GetBitmap();
1603 } 1601 }
1604 } 1602 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698