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

Side by Side Diff: core/src/fxge/android/fpf_skiafontmgr.cpp

Issue 1192743004: Cleanup: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 6 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 | « core/src/fxge/agg/src/fx_agg_driver.cpp ('k') | core/src/fxge/android/fpf_skiamodule.cpp » ('j') | 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 "fx_fpf.h" 7 #include "fx_fpf.h"
8 #if _FX_OS_ == _FX_ANDROID_ 8 #if _FX_OS_ == _FX_ANDROID_
9 #define FPF_SKIAMATCHWEIGHT_NAME1 62 9 #define FPF_SKIAMATCHWEIGHT_NAME1 62
10 #define FPF_SKIAMATCHWEIGHT_NAME2 60 10 #define FPF_SKIAMATCHWEIGHT_NAME2 60
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 FX_POSITION pos = m_FamilyFonts.GetStartPosition(); 238 FX_POSITION pos = m_FamilyFonts.GetStartPosition();
239 while (pos) { 239 while (pos) {
240 m_FamilyFonts.GetNextAssoc(pos, pkey, (void*&)pValue); 240 m_FamilyFonts.GetNextAssoc(pos, pkey, (void*&)pValue);
241 if (pValue) { 241 if (pValue) {
242 pValue->Release(); 242 pValue->Release();
243 } 243 }
244 } 244 }
245 m_FamilyFonts.RemoveAll(); 245 m_FamilyFonts.RemoveAll();
246 for (int32_t i = m_FontFaces.GetUpperBound(); i >= 0; i--) { 246 for (int32_t i = m_FontFaces.GetUpperBound(); i >= 0; i--) {
247 CFPF_SkiaFontDescriptor *pFont = (CFPF_SkiaFontDescriptor*)m_FontFaces.E lementAt(i); 247 CFPF_SkiaFontDescriptor *pFont = (CFPF_SkiaFontDescriptor*)m_FontFaces.E lementAt(i);
248 if (pFont) { 248 delete pFont;
249 delete pFont;
250 }
251 } 249 }
252 m_FontFaces.RemoveAll(); 250 m_FontFaces.RemoveAll();
253 if (m_FTLibrary) { 251 if (m_FTLibrary) {
254 FXFT_Done_FreeType(m_FTLibrary); 252 FXFT_Done_FreeType(m_FTLibrary);
255 } 253 }
256 } 254 }
257 FX_BOOL CFPF_SkiaFontMgr::InitFTLibrary() 255 FX_BOOL CFPF_SkiaFontMgr::InitFTLibrary()
258 { 256 {
259 if (m_FTLibrary == NULL) { 257 if (m_FTLibrary == NULL) {
260 FXFT_Init_FreeType(&m_FTLibrary); 258 FXFT_Init_FreeType(&m_FTLibrary);
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 pFontDesc->m_dwStyle |= FXFONT_SYMBOLIC; 543 pFontDesc->m_dwStyle |= FXFONT_SYMBOLIC;
546 } 544 }
547 pFontDesc->m_dwCharsets = FPF_SkiaGetFaceCharset(pOS2); 545 pFontDesc->m_dwCharsets = FPF_SkiaGetFaceCharset(pOS2);
548 pFontDesc->m_iFaceIndex = face->face_index; 546 pFontDesc->m_iFaceIndex = face->face_index;
549 pFontDesc->m_iGlyphNum = face->num_glyphs; 547 pFontDesc->m_iGlyphNum = face->num_glyphs;
550 } 548 }
551 void CFPF_SkiaFontMgr::OutputSystemFonts() 549 void CFPF_SkiaFontMgr::OutputSystemFonts()
552 { 550 {
553 } 551 }
554 #endif 552 #endif
OLDNEW
« no previous file with comments | « core/src/fxge/agg/src/fx_agg_driver.cpp ('k') | core/src/fxge/android/fpf_skiamodule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698