vtgl

terminal emulator implemented in OpenGL
git clone anongit@rnpnr.xyz:vtgl.git
Log | Files | Refs | Feed | LICENSE

Commit: 978e8aeb16dc03fe47a476093c5f4fc4a593daa2
Parent: fa3d50abb359c1e0f477e700ed2cce57f475fbb0
Author: Randy Palamar
Date:   Fri, 23 Aug 2024 09:22:20 -0600

font: destroy pattern after loading font

FcPatternGetString returns an internal string that gets freed when
the pattern is destroyed.

Diffstat:
Mfont.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/font.c b/font.c @@ -24,10 +24,10 @@ init_font(FontAtlas *fa, Font *f, u8 *fontstr) goto err_fc2; f->fontsize = (u32)pixelsize; - FcPatternDestroy(font); - os_mapped_file map = os_map_file((char *)file, OS_MAP_READ, OS_MAP_PRIVATE); + FcPatternDestroy(font); + f->bufsize = map.len; f->buf = map.data;