No need to release resources in destructor of CPDF_ShadingObject
authorBo Xu <bo_xu@foxitsoftware.com>
Thu, 28 Aug 2014 18:49:17 +0000 (11:49 -0700)
committerBo Xu <bo_xu@foxitsoftware.com>
Thu, 28 Aug 2014 18:49:17 +0000 (11:49 -0700)
CPDF_DocPageData::~CPDF_DocPageData() will force to release all resources, so no need to do it here, which can result in heap-use-after-free trouble.

BUG=408164
R=jun_fang@foxitsoftware.com, tsepez@chromium.org

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

core/src/fpdfapi/fpdf_page/fpdf_page.cpp

index 6d3cf29..590a01a 100644 (file)
@@ -606,10 +606,6 @@ CPDF_ShadingObject::CPDF_ShadingObject()
 }
 CPDF_ShadingObject::~CPDF_ShadingObject()
 {
-    CPDF_ShadingPattern* pShading = m_pShading;
-    if (pShading && pShading->m_pDocument) {
-        pShading->m_pDocument->GetPageData()->ReleasePattern(pShading->m_pShadingObj);
-    }
 }
 void CPDF_ShadingObject::CopyData(const CPDF_PageObject* pSrc)
 {