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

Unified Diff: xfa/fgas/font/fgas_stdfontmgr.cpp

Issue 2322483003: Fix leaks in class CFGAS_FontMgrImp (Closed)
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/font/fgas_stdfontmgr.cpp
diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp
index 7e5cfbb796541347843c2a775739733963f7db1d..a0e7e39a4097cbcb0f1a74177f56fd785d344276 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.cpp
+++ b/xfa/fgas/font/fgas_stdfontmgr.cpp
@@ -591,6 +591,8 @@ CFGAS_FontMgrImp::~CFGAS_FontMgrImp() {
uint32_t dwHash;
CFX_ArrayTemplate<CFGAS_GEFont*>* pFonts;
m_Hash2Fonts.GetNextAssoc(pos, dwHash, pFonts);
+ for (int32_t i = 0; i < pFonts->GetSize(); i++)
+ delete pFonts->GetAt(i);
delete pFonts;
}
m_Hash2Fonts.RemoveAll();
@@ -845,11 +847,6 @@ CFGAS_GEFont* CFGAS_FontMgrImp::LoadFont(const CFX_WideString& wsFaceName,
if (!pFontStream)
return nullptr;
- if (!LoadFace(pFontStream, 0)) {
- pFontStream->Release();
- return nullptr;
- }
-
CFX_Font* pInternalFont = new CFX_Font();
if (!pInternalFont->LoadFile(pFontStream, iFaceIndex)) {
pFontStream->Release();
« 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