mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-06 20:39:38 +01:00
Codefix: SpriteFontCache was never deleted. (#14414)
This commit is contained in:
parent
ebd984d894
commit
84e9e106c1
@ -43,7 +43,7 @@ FontCache::FontCache(FontSize fs) : parent(FontCache::Get(fs)), fs(fs), height(_
|
||||
/** Clean everything up. */
|
||||
FontCache::~FontCache()
|
||||
{
|
||||
assert(this->fs == this->parent->fs);
|
||||
assert(this->parent == nullptr || this->fs == this->parent->fs);
|
||||
FontCache::caches[this->fs] = this->parent;
|
||||
Layouter::ResetFontCache(this->fs);
|
||||
}
|
||||
@ -241,8 +241,7 @@ void InitFontCache(bool monospace)
|
||||
void UninitFontCache()
|
||||
{
|
||||
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
|
||||
FontCache *fc = FontCache::Get(fs);
|
||||
if (fc->HasParent()) delete fc;
|
||||
while (FontCache::Get(fs) != nullptr) delete FontCache::Get(fs);
|
||||
}
|
||||
|
||||
#ifdef WITH_FREETYPE
|
||||
|
Loading…
Reference in New Issue
Block a user