diff options
author | Bo Xu <bo_xu@foxitsoftware.com> | 2014-09-16 13:24:37 -0700 |
---|---|---|
committer | Bo Xu <bo_xu@foxitsoftware.com> | 2014-09-16 13:24:37 -0700 |
commit | 69dcf148b3755c11d5da47fbee767aa920ee2f58 (patch) | |
tree | 94aed55258480846c8f757a9db308a70975c800f /core/src | |
parent | 4481496892d3d9555556df54edd6f98e9f63645e (diff) | |
download | pdfium-69dcf148b3755c11d5da47fbee767aa920ee2f58.tar.xz |
When forcing clear page data, no need to release colorspace when releasing pattern
BUG=414661
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/572853006
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp | 1 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp | 4 |
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; |