summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp16
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp4
2 files changed, 6 insertions, 14 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
index 6a876a2390..cdbecd65ea 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
@@ -188,20 +188,14 @@ CPDF_ImageCache::CPDF_ImageCache(CPDF_Document* pDoc, CPDF_Stream* pStream)
}
CPDF_ImageCache::~CPDF_ImageCache()
{
- if (m_pCachedBitmap) {
- delete m_pCachedBitmap;
- m_pCachedBitmap = NULL;
- }
- if (m_pCachedMask) {
- delete m_pCachedMask;
- m_pCachedMask = NULL;
- }
+ delete m_pCachedBitmap;
+ m_pCachedBitmap = NULL;
+ delete m_pCachedMask;
+ m_pCachedMask = NULL;
}
void CPDF_ImageCache::Reset(const CFX_DIBitmap* pBitmap)
{
- if (m_pCachedBitmap) {
- delete m_pCachedBitmap;
- }
+ delete m_pCachedBitmap;
m_pCachedBitmap = NULL;
if (pBitmap) {
m_pCachedBitmap = pBitmap->Clone();
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 5748e23efe..3ee2222d8b 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -994,9 +994,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_Pag
m_pDevice->RestoreState();
}
m_pDevice->RestoreState();
- if (pStates) {
- delete pStates;
- }
+ delete pStates;
return;
}
if (bAligned) {