Move pango_cairo_font_map_set_default() to font.c

This commit is contained in:
Johan Malm 2020-10-31 15:41:06 +00:00
parent 2f44e954aa
commit 58fdf9776f
3 changed files with 14 additions and 4 deletions

View file

@ -7,4 +7,10 @@
*/
int font_height(const char *font_description);
/**
* font_finish - free some font related resources
* Note: use on exit
*/
void font_finish(void);
#endif /* __LABWC_FONT_H */

View file

@ -42,3 +42,9 @@ font_height(const char *font_description)
rectangle = font_extents(font_description, "abcdefg");
return rectangle.height;
}
void
font_finish(void)
{
pango_cairo_font_map_set_default(NULL);
}

View file

@ -1,13 +1,11 @@
#include "common/spawn.h"
#include "common/font.h"
#include "config/session.h"
#include "labwc.h"
#include "theme/theme.h"
#include "xbm/xbm.h"
#include "menu/menu.h"
#include <cairo.h>
#include <pango/pangocairo.h>
struct rcxml rc = { 0 };
struct theme theme = { 0 };
@ -95,6 +93,6 @@ main(int argc, char *argv[])
server_finish(&server);
rcxml_finish();
menu_finish(server.rootmenu);
pango_cairo_font_map_set_default(NULL);
font_finish();
return 0;
}