mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Fix memory leak detected by address sanitizer (#10896)
This commit is contained in:
parent
f227e40180
commit
2072afb72b
4 changed files with 7 additions and 3 deletions
|
@ -378,6 +378,7 @@ bool CGUITTFont::load(const io::path& filename, const u32 size, const bool antia
|
|||
}
|
||||
|
||||
// Store our face.
|
||||
sguitt_face = face;
|
||||
tt_face = face->face;
|
||||
|
||||
// Store font metrics.
|
||||
|
@ -436,6 +437,9 @@ CGUITTFont::~CGUITTFont()
|
|||
// Drop our driver now.
|
||||
if (Driver)
|
||||
Driver->drop();
|
||||
|
||||
// Destroy sguitt_face after clearing c_faces
|
||||
delete sguitt_face;
|
||||
}
|
||||
|
||||
void CGUITTFont::reset_images()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue