Skip to content

Commit eff9217

Browse files
committed
Don't free a font that hasn't been created
1 parent f226149 commit eff9217

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/ft2font.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ PYCXX_NOARGS_METHOD_DECL(FT2Font, get_path)
846846

847847
FT2Font::FT2Font(Py::PythonClassInstance *self, Py::Tuple &args, Py::Dict &kwds) :
848848
Py::PythonClass<FT2Font>(self, args, kwds),
849+
face(NULL),
849850
image()
850851
{
851852
FT_Open_Args open_args;
@@ -975,7 +976,9 @@ FT2Font::~FT2Font()
975976
{
976977
_VERBOSE("FT2Font::~FT2Font");
977978

978-
FT_Done_Face(face);
979+
if (face) {
980+
FT_Done_Face(face);
981+
}
979982

980983
for (size_t i = 0; i < glyphs.size(); i++)
981984
{

0 commit comments

Comments
 (0)