summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--font-viewer/font-model.c2
-rw-r--r--font-viewer/font-view.c14
2 files changed, 14 insertions, 2 deletions
diff --git a/font-viewer/font-model.c b/font-viewer/font-model.c
index 6681b842..9a365527 100644
--- a/font-viewer/font-model.c
+++ b/font-viewer/font-model.c
@@ -440,8 +440,6 @@ font_view_model_init (FontViewModel *self)
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, FONT_VIEW_TYPE_MODEL, FontViewModelPrivate);
- if (!FcInit())
- g_critical ("Can't initialize fontconfig library");
if (FT_Init_FreeType (&self->priv->library) != FT_Err_Ok)
g_critical ("Can't initialize FreeType library");
diff --git a/font-viewer/font-view.c b/font-viewer/font-view.c
index a62a75e8..4457fe16 100644
--- a/font-viewer/font-view.c
+++ b/font-viewer/font-view.c
@@ -31,6 +31,7 @@
#include FT_SFNT_NAMES_H
#include FT_TRUETYPE_IDS_H
#include <cairo/cairo-ft.h>
+#include <fontconfig/fontconfig.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
@@ -655,6 +656,14 @@ font_view_application_activate (GApplication *application)
}
static void
+font_view_application_quit_mainloop (GApplication *application)
+{
+ G_APPLICATION_CLASS (font_view_application_parent_class)->quit_mainloop (application);
+
+ FcFini ();
+}
+
+static void
font_view_application_dispose (GObject *obj)
{
FontViewApplication *self = FONT_VIEW_APPLICATION (obj);
@@ -679,6 +688,7 @@ font_view_application_class_init (FontViewApplicationClass *klass)
aclass->activate = font_view_application_activate;
aclass->startup = font_view_application_startup;
aclass->open = font_view_application_open;
+ aclass->quit_mainloop = font_view_application_quit_mainloop;
oclass->dispose = font_view_application_dispose;
}
@@ -687,6 +697,10 @@ static GApplication *
font_view_application_new (void)
{
g_type_init ();
+
+ if (!FcInit ())
+ g_critical ("Can't initialize fontconfig library");
+
return g_object_new (FONT_VIEW_TYPE_APPLICATION,
"application-id", "org.mate.font-viewer",
"flags", G_APPLICATION_HANDLES_OPEN,