No need to release m_pBaseCS in CPDF_IndexedCS and CPDF_PatternCS
authorBo Xu <bo_xu@foxitsoftware.com>
Mon, 18 Aug 2014 16:58:58 +0000 (09:58 -0700)
committerBo Xu <bo_xu@foxitsoftware.com>
Mon, 18 Aug 2014 16:58:58 +0000 (09:58 -0700)
m_pBaseCS will be released in CPDF_DocPageData::Clear.

BUG=401372
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/472653002

core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp

index 6c2701f..da48093 100644 (file)
@@ -754,10 +754,6 @@ CPDF_IndexedCS::~CPDF_IndexedCS()
     if (m_pCompMinMax) {
         FX_Free(m_pCompMinMax);
     }
-    CPDF_ColorSpace* pCS = m_pBaseCS;
-    if (pCS && m_pDocument) {
-        m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
-    }
 }
 FX_BOOL CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
 {
@@ -837,10 +833,6 @@ CPDF_PatternCS::CPDF_PatternCS()
 }
 CPDF_PatternCS::~CPDF_PatternCS()
 {
-    CPDF_ColorSpace* pCS = m_pBaseCS;
-    if (pCS && m_pDocument) {
-        m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
-    }
 }
 FX_BOOL CPDF_PatternCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
 {