summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp1
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 131edbe9b5..77db4534fb 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -229,6 +229,7 @@ void CPDF_DocPageData::Clear(FX_BOOL bForceRelease)
m_PatternMap.GetNextAssoc(pos, ptObj, ptData);
nCount = ptData->m_nCount;
if (bForceRelease || nCount < 2) {
+ ptData->m_Obj->SetForceClear(bForceRelease);
delete ptData->m_Obj;
ptData->m_Obj = NULL;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
index bcb8196662..67ea4fee65 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
@@ -8,7 +8,7 @@
#include "pageint.h"
CPDF_Pattern::CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix) :
- m_pPatternObj(NULL), m_PatternType(PATTERN_TILING), m_pDocument(NULL)
+ m_pPatternObj(NULL), m_PatternType(PATTERN_TILING), m_pDocument(NULL), m_bForceClear(FALSE)
{
if (pParentMatrix) {
m_ParentMatrix = *pParentMatrix;
@@ -97,7 +97,7 @@ void CPDF_ShadingPattern::Clear()
m_pFunctions[i] = NULL;
}
CPDF_ColorSpace* pCS = m_pCS;
- if (pCS && m_pDocument) {
+ if (!m_bForceClear && pCS && m_pDocument) {
m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
}
m_ShadingType = 0;