summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Davis <christopherdavis@gnome.org>2022-10-10 19:10:58 -0400
committerChristopher Davis <christopherdavis@gnome.org>2022-10-10 19:10:58 -0400
commit2ee1f40cd6739e78ced26c60a3cd1b25fa0c2856 (patch)
treedc3c20ecd5bce17ad51c735a056a255b59d429ef
parent867f8681d3f5070fc87de1780ebe47cb7e83019a (diff)
downloadgnome-font-viewer-2ee1f40cd6739e78ced26c60a3cd1b25fa0c2856.tar.gz
font-model: Leak cleanups
-rw-r--r--src/font-model.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/font-model.c b/src/font-model.c
index e26811e..5381c92 100644
--- a/src/font-model.c
+++ b/src/font-model.c
@@ -140,8 +140,8 @@ font_view_model_item_new (const gchar *font_name,
FontViewModelItem *item = g_object_new (FONT_VIEW_TYPE_MODEL_ITEM, NULL);
item->font_name = g_strdup (font_name);
- item->font_preview_text = g_strdup (font_preview_text);
- item->font_description = pango_font_description_copy (font_description);
+ item->font_preview_text = (gchar *) font_preview_text;
+ item->font_description = (PangoFontDescription *) font_description;
item->file = g_object_ref (file);
item->face_index = face_index;
@@ -189,7 +189,7 @@ font_view_model_has_face (FontViewModel *self, FT_Face face)
match_name = sushi_get_font_name (face, TRUE);
for (idx = 0; idx < n_items; idx++) {
- FontViewModelItem *item =
+ g_autoptr (FontViewModelItem) item =
g_list_model_get_item (G_LIST_MODEL (self->model), idx);
if (g_strcmp0 (item->font_name, match_name) == 0)
@@ -466,9 +466,9 @@ connect_to_fontconfig_updates (FontViewModel *self)
GtkSettings *settings;
settings = gtk_settings_get_default ();
- self->fontconfig_update_id =
- g_signal_connect_swapped (settings, "notify::gtk-fontconfig-timestamp",
- G_CALLBACK (ensure_font_list), self);
+ g_signal_connect_object (settings, "notify::gtk-fontconfig-timestamp",
+ G_CALLBACK (ensure_font_list), self,
+ G_CONNECT_SWAPPED);
}
static void