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

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp

Issue 554913003: Change the forced clear order of CPDF_DocPageData::Clear, and remove m_pDocument in CPDF_Color (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nit 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 16f0a9cfad1c7ce644ba7f7374c4c6f40f6dd3bf..131edbe9b59febd639195bec1ed83c0bca7adb8a 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -154,17 +154,6 @@ void CPDF_DocPageData::Clear(FX_BOOL bForceRelease)
FX_DWORD nCount;
m_bForceClear = bForceRelease;
- pos = m_PatternMap.GetStartPosition();
- while (pos) {
- CPDF_Object* ptObj;
- CPDF_CountedObject<CPDF_Pattern*>* ptData;
- m_PatternMap.GetNextAssoc(pos, ptObj, ptData);
- nCount = ptData->m_nCount;
- if (bForceRelease || nCount < 2) {
- delete ptData->m_Obj;
- ptData->m_Obj = NULL;
- }
- }
pos = m_FontMap.GetStartPosition();
while (pos) {
CPDF_Dictionary* fontDict;
@@ -233,6 +222,17 @@ void CPDF_DocPageData::Clear(FX_BOOL bForceRelease)
m_FontFileMap.RemoveKey(ftKey);
}
}
+ pos = m_PatternMap.GetStartPosition();
+ while (pos) {
+ CPDF_Object* ptObj;
+ CPDF_CountedObject<CPDF_Pattern*>* ptData;
+ m_PatternMap.GetNextAssoc(pos, ptObj, ptData);
+ nCount = ptData->m_nCount;
+ if (bForceRelease || nCount < 2) {
+ delete ptData->m_Obj;
+ ptData->m_Obj = NULL;
+ }
+ }
}
CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly)
{
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698