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

Unified Diff: core/src/fpdfapi/fpdf_render/fpdf_render.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: nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_render/fpdf_render.cpp
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
index c4a9d7761b3bfc9fc4bac715bcc0a8f27d3a9399..a894e846ee130a397367c1855ef5da69c9ba9869 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -202,9 +202,7 @@ CPDF_RenderStatus::CPDF_RenderStatus()
CPDF_RenderStatus::~CPDF_RenderStatus()
{
- if (m_pObjectRenderer) {
- delete m_pObjectRenderer;
- }
+ delete m_pObjectRenderer;
}
FX_BOOL CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice,
@@ -665,9 +663,7 @@ void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_Affine
ProcessText(pText, pObj2Device, pTextClippingPath);
}
}
- if (pTextClippingPath) {
- delete pTextClippingPath;
- }
+ delete pTextClippingPath;
}
void CPDF_RenderStatus::DrawClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device)
{
@@ -859,9 +855,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj,
Transparency |= PDFTRANS_GROUP;
}
CompositeDIBitmap(bitmap, rect.left, rect.top, 0, 255, blend_type, Transparency);
- if (oriDevice) {
- delete oriDevice;
- }
+ delete oriDevice;
return TRUE;
}
CFX_DIBitmap* CPDF_RenderStatus::GetBackdrop(const CPDF_PageObject* pObj, const FX_RECT& rect, int& left, int& top,
@@ -1271,9 +1265,7 @@ CPDF_DeviceBuffer::CPDF_DeviceBuffer()
}
CPDF_DeviceBuffer::~CPDF_DeviceBuffer()
{
- if (m_pBitmap) {
- delete m_pBitmap;
- }
+ delete m_pBitmap;
}
FX_BOOL CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
const CPDF_PageObject* pObj, int max_dpi)
@@ -1330,9 +1322,7 @@ CPDF_ScaledRenderBuffer::CPDF_ScaledRenderBuffer()
}
CPDF_ScaledRenderBuffer::~CPDF_ScaledRenderBuffer()
{
- if (m_pBitmapDevice) {
- delete m_pBitmapDevice;
- }
+ delete m_pBitmapDevice;
}
#define _FPDFAPI_IMAGESIZE_LIMIT_ (30 * 1024 * 1024)
FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698