main: mention why we initialize a font set

Since fonts are destroyed and removed from the font cache when the
last instance is destroyed, closing the "last" terminal window in
server mode would destroy the fonts, and their glyph caches.

By instantiating the set in main, we ensure the fonts, and the glyph
caches, remain. This makes launching new terminals (much) faster.

Note that in "normal" (non-server) mode, this isn't really necessary,
but also doesn't have any penalty.
This commit is contained in:
Daniel Eklöf 2019-11-20 19:27:16 +01:00
parent f3d212224b
commit 4f4ee5b39d
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

1
main.c
View file

@ -190,6 +190,7 @@ main(int argc, char *const *argv)
struct server *server = NULL;
struct shutdown_context shutdown_ctx = {.term = &term, .exit_code = EXIT_FAILURE};
/* This ensures we keep a set of fonts in the cache */
if (!initialize_fonts(&conf, fonts))
goto out;