From 729395c88766dbf61878a155052a40ce53a29081 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 31 Oct 2017 01:47:14 +0530 Subject: [PATCH] Release old hb_font when changing font size --- kitty/core_text.m | 1 + 1 file changed, 1 insertion(+) diff --git a/kitty/core_text.m b/kitty/core_text.m index 062d71744..b7d0dfd8e 100644 --- a/kitty/core_text.m +++ b/kitty/core_text.m @@ -144,6 +144,7 @@ apply_size(Face *self, float point_sz, float dpi) { if (face == NULL) { PyErr_SetString(PyExc_ValueError, "Failed to create hb_face"); return false; } CGFontRelease(cg_font); unsigned int upem = hb_face_get_upem(face); + if (self->harfbuzz_font) hb_font_destroy(self->harfbuzz_font); self->harfbuzz_font = hb_font_create(face); hb_face_destroy(face); hb_font_set_scale(self->harfbuzz_font, upem, upem);