Fix COreText leak on exit

This commit is contained in:
Kovid Goyal 2017-12-13 08:27:33 +05:30
parent 47704f24c1
commit a1b4f7c92d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -75,10 +75,11 @@ ct_face(CTFontRef font) {
static void
dealloc(CTFace* self) {
if (self->ct_font) CFRelease(self->ct_font);
if (self->hb_font) hb_font_destroy(self->hb_font);
if (self->ct_font) CFRelease(self->ct_font);
self->hb_font = NULL;
self->ct_font = NULL;
Py_CLEAR(self->family_name); Py_CLEAR(self->full_name); Py_CLEAR(self->postscript_name); Py_CLEAR(self->path);
Py_TYPE(self)->tp_free((PyObject*)self);
}