Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page.cpp

Issue 513063003: No need to release resources in destructor of CPDF_ShadingObject (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../../include/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "pageint.h" 9 #include "pageint.h"
10 void CPDF_PageObject::Release() 10 void CPDF_PageObject::Release()
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 m_TextState = TextState; 599 m_TextState = TextState;
600 CalcPositionData(NULL, NULL, 0); 600 CalcPositionData(NULL, NULL, 0);
601 } 601 }
602 CPDF_ShadingObject::CPDF_ShadingObject() 602 CPDF_ShadingObject::CPDF_ShadingObject()
603 { 603 {
604 m_pShading = NULL; 604 m_pShading = NULL;
605 m_Type = PDFPAGE_SHADING; 605 m_Type = PDFPAGE_SHADING;
606 } 606 }
607 CPDF_ShadingObject::~CPDF_ShadingObject() 607 CPDF_ShadingObject::~CPDF_ShadingObject()
608 { 608 {
609 CPDF_ShadingPattern* pShading = m_pShading;
610 if (pShading && pShading->m_pDocument) {
611 pShading->m_pDocument->GetPageData()->ReleasePattern(pShading->m_pShadin gObj);
jun_fang 2014/08/28 16:38:14 Maybe you can save a reference to document rather
Bo Xu 2014/08/28 17:07:24 Since we ensure to do forced clear on Patterns in
612 }
613 } 609 }
614 void CPDF_ShadingObject::CopyData(const CPDF_PageObject* pSrc) 610 void CPDF_ShadingObject::CopyData(const CPDF_PageObject* pSrc)
615 { 611 {
616 CPDF_ShadingObject* pSrcObj = (CPDF_ShadingObject*)pSrc; 612 CPDF_ShadingObject* pSrcObj = (CPDF_ShadingObject*)pSrc;
617 m_pShading = pSrcObj->m_pShading; 613 m_pShading = pSrcObj->m_pShading;
618 if (m_pShading && m_pShading->m_pDocument) { 614 if (m_pShading && m_pShading->m_pDocument) {
619 CPDF_DocPageData* pDocPageData = m_pShading->m_pDocument->GetPageData(); 615 CPDF_DocPageData* pDocPageData = m_pShading->m_pDocument->GetPageData();
620 m_pShading = (CPDF_ShadingPattern*)pDocPageData->GetPattern(m_pShading-> m_pShadingObj, m_pShading->m_bShadingObj, &m_pShading->m_ParentMatrix); 616 m_pShading = (CPDF_ShadingPattern*)pDocPageData->GetPattern(m_pShading-> m_pShadingObj, m_pShading->m_bShadingObj, &m_pShading->m_ParentMatrix);
621 } 617 }
622 m_Matrix = pSrcObj->m_Matrix; 618 m_Matrix = pSrcObj->m_Matrix;
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 matrix = m_PageMatrix; 1031 matrix = m_PageMatrix;
1036 matrix.Concat(display_matrix); 1032 matrix.Concat(display_matrix);
1037 } 1033 }
1038 CPDF_ParseOptions::CPDF_ParseOptions() 1034 CPDF_ParseOptions::CPDF_ParseOptions()
1039 { 1035 {
1040 m_bTextOnly = FALSE; 1036 m_bTextOnly = FALSE;
1041 m_bMarkedContent = TRUE; 1037 m_bMarkedContent = TRUE;
1042 m_bSeparateForm = TRUE; 1038 m_bSeparateForm = TRUE;
1043 m_bDecodeInlineImage = FALSE; 1039 m_bDecodeInlineImage = FALSE;
1044 } 1040 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698