aboutsummaryrefslogtreecommitdiffstats
path: root/libskrift_close_font.c
blob: c665cdb293ed7b577e2e7f1bf0234fa31cb9ff75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* See LICENSE file for copyright and license details. */
#include "common.h"

void
libskrift_close_font(LIBSKRIFT_FONT *font)
{
	if (font && !--font->refcount) {
		if (font->font_type == FONT_TYPE_SCHRIFT)
			sft_freefont(font->font.schrift);
		free(font->memory_free);
		if (font->memory_unmap)
			munmap(font->memory_unmap, font->memory_size);
		free(font);
	}
}