FBFontRenderClass/CNeutrinoFonts: ensure reset of some instances

Only for safety.


Origin commit data
------------------
Commit: 71d0c42a47
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-06-15 (Thu, 15 Jun 2017)
This commit is contained in:
2017-06-15 01:01:54 +02:00
parent 02b6bd4930
commit 2d38d38b11
2 changed files with 10 additions and 4 deletions

View File

@@ -99,7 +99,7 @@ FBFontRenderClass::~FBFontRenderClass()
for (fontListEntry * f = font; f; f = g) for (fontListEntry * f = font; f; f = g)
{ {
g = f->next; g = f->next;
delete f; delete f; f = NULL;
} }
FTC_Manager_Done(cacheManager); FTC_Manager_Done(cacheManager);

View File

@@ -92,14 +92,18 @@ void CNeutrinoFonts::InitDynFonts()
CNeutrinoFonts::~CNeutrinoFonts() CNeutrinoFonts::~CNeutrinoFonts()
{ {
if (!v_share_fonts.empty()) { if (!v_share_fonts.empty()) {
for (unsigned int i = 0; i < v_share_fonts.size(); i++) for (unsigned int i = 0; i < v_share_fonts.size(); i++){
delete v_share_fonts[i].font; delete v_share_fonts[i].font;
v_share_fonts[i].font = NULL;
}
v_share_fonts.clear(); v_share_fonts.clear();
} }
if (!v_dyn_fonts.empty()) { if (!v_dyn_fonts.empty()) {
for (unsigned int i = 0; i < v_dyn_fonts.size(); i++) for (unsigned int i = 0; i < v_dyn_fonts.size(); i++){
delete v_dyn_fonts[i].font; delete v_dyn_fonts[i].font;
v_dyn_fonts[i].font = NULL;
}
v_dyn_fonts.clear(); v_dyn_fonts.clear();
} }
if (!vDynSize.empty()) { if (!vDynSize.empty()) {
@@ -402,8 +406,10 @@ void CNeutrinoFonts::deleteDynFontExtAll()
{ {
if (!v_dyn_fonts_ext.empty()) { if (!v_dyn_fonts_ext.empty()) {
for (size_t i = 0; i < v_dyn_fonts_ext.size(); ++i) { for (size_t i = 0; i < v_dyn_fonts_ext.size(); ++i) {
if (v_dyn_fonts_ext[i].font != NULL) if (v_dyn_fonts_ext[i].font != NULL){
delete v_dyn_fonts_ext[i].font; delete v_dyn_fonts_ext[i].font;
v_dyn_fonts_ext[i].font = NULL;
}
} }
v_dyn_fonts_ext.clear(); v_dyn_fonts_ext.clear();
} }