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

Side by Side Diff: core/src/fxge/ge/fx_ge_fontmap.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/ge/fx_ge_font.cpp ('k') | core/src/fxge/ge/fx_ge_text.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 <limits> 7 #include <limits>
8 8
9 #include "../../../include/fxge/fx_ge.h" 9 #include "../../../include/fxge/fx_ge.h"
10 #include "../../../include/fxge/fx_freetype.h" 10 #include "../../../include/fxge/fx_freetype.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 CFX_FontMgr::CFX_FontMgr() 64 CFX_FontMgr::CFX_FontMgr()
65 { 65 {
66 m_pBuiltinMapper = new CFX_FontMapper; 66 m_pBuiltinMapper = new CFX_FontMapper;
67 m_pBuiltinMapper->m_pFontMgr = this; 67 m_pBuiltinMapper->m_pFontMgr = this;
68 m_pExtMapper = NULL; 68 m_pExtMapper = NULL;
69 m_FTLibrary = NULL; 69 m_FTLibrary = NULL;
70 FXSYS_memset(m_ExternalFonts, 0, sizeof m_ExternalFonts); 70 FXSYS_memset(m_ExternalFonts, 0, sizeof m_ExternalFonts);
71 } 71 }
72 CFX_FontMgr::~CFX_FontMgr() 72 CFX_FontMgr::~CFX_FontMgr()
73 { 73 {
74 if (m_pBuiltinMapper) { 74 delete m_pBuiltinMapper;
75 delete m_pBuiltinMapper;
76 }
77 FreeCache(); 75 FreeCache();
78 if (m_FTLibrary) { 76 if (m_FTLibrary) {
79 FXFT_Done_FreeType(m_FTLibrary); 77 FXFT_Done_FreeType(m_FTLibrary);
80 } 78 }
81 } 79 }
82 void CFX_FontMgr::InitFTLibrary() 80 void CFX_FontMgr::InitFTLibrary()
83 { 81 {
84 if (m_FTLibrary == NULL) { 82 if (m_FTLibrary == NULL) {
85 FXFT_Init_FreeType(&m_FTLibrary); 83 FXFT_Init_FreeType(&m_FTLibrary);
86 } 84 }
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 return FALSE; 1516 return FALSE;
1519 } 1517 }
1520 CFontFaceInfo* pFont = (CFontFaceInfo*)hFont; 1518 CFontFaceInfo* pFont = (CFontFaceInfo*)hFont;
1521 name = pFont->m_FaceName; 1519 name = pFont->m_FaceName;
1522 return TRUE; 1520 return TRUE;
1523 } 1521 }
1524 FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset) 1522 FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset)
1525 { 1523 {
1526 return FALSE; 1524 return FALSE;
1527 } 1525 }
OLDNEW
« no previous file with comments | « core/src/fxge/ge/fx_ge_font.cpp ('k') | core/src/fxge/ge/fx_ge_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698