mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-07 04:49: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. */
|
/** Clean everything up. */
|
||||||
FontCache::~FontCache()
|
FontCache::~FontCache()
|
||||||
{
|
{
|
||||||
assert(this->fs == this->parent->fs);
|
assert(this->parent == nullptr || this->fs == this->parent->fs);
|
||||||
FontCache::caches[this->fs] = this->parent;
|
FontCache::caches[this->fs] = this->parent;
|
||||||
Layouter::ResetFontCache(this->fs);
|
Layouter::ResetFontCache(this->fs);
|
||||||
}
|
}
|
||||||
@ -241,8 +241,7 @@ void InitFontCache(bool monospace)
|
|||||||
void UninitFontCache()
|
void UninitFontCache()
|
||||||
{
|
{
|
||||||
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
|
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
|
||||||
FontCache *fc = FontCache::Get(fs);
|
while (FontCache::Get(fs) != nullptr) delete FontCache::Get(fs);
|
||||||
if (fc->HasParent()) delete fc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_FREETYPE
|
#ifdef WITH_FREETYPE
|
||||||
|
Loading…
Reference in New Issue
Block a user