CFX_FontMgr::~CFX_FontMgr() { delete m_pBuiltinMapper; FreeCache(); if (m_FTLibrary) { FXFT_Done_FreeType(m_FTLibrary); } }
CFX_FontMgr::~CFX_FontMgr() { for (const auto& pair : m_FaceMap) delete pair.second; // |m_pBuiltinMapper| references |m_FTLibrary|, so it has to be destroyed // first. m_pBuiltinMapper.reset(); FXFT_Done_FreeType(m_FTLibrary); }
CFPF_SkiaFontMgr::~CFPF_SkiaFontMgr() { for (const auto& pair : m_FamilyFonts) { if (pair.second) pair.second->Release(); } m_FamilyFonts.clear(); for (auto it = m_FontFaces.rbegin(); it != m_FontFaces.rend(); ++it) { delete *it; } m_FontFaces.clear(); if (m_FTLibrary) { FXFT_Done_FreeType(m_FTLibrary); } }
CFPF_SkiaFontMgr::~CFPF_SkiaFontMgr() { void *pkey = NULL; CFPF_SkiaFont *pValue = NULL; FX_POSITION pos = m_FamilyFonts.GetStartPosition(); while (pos) { m_FamilyFonts.GetNextAssoc(pos, pkey, (void*&)pValue); if (pValue) { pValue->Release(); } } m_FamilyFonts.RemoveAll(); for (FX_INT32 i = m_FontFaces.GetUpperBound(); i >= 0; i--) { CFPF_SkiaFontDescriptor *pFont = (CFPF_SkiaFontDescriptor*)m_FontFaces.ElementAt(i); if (pFont) { delete pFont; } } m_FontFaces.RemoveAll(); if (m_FTLibrary) { FXFT_Done_FreeType(m_FTLibrary); } }