Fix search filter memory leaks

This commit is contained in:
correctmost
2024-03-21 22:07:55 -04:00
parent 305c8cd099
commit 823c74dd47
2 changed files with 5 additions and 1 deletions

View File

@@ -259,6 +259,9 @@ xtm_process_tree_view_finalize (GObject *object)
g_object_unref (treeview->settings);
}
g_free (treeview->cmd_filter);
treeview->cmd_filter = NULL;
G_OBJECT_CLASS (xtm_process_tree_view_parent_class)->finalize (object);
}

View File

@@ -190,11 +190,12 @@ static void
filter_entry_keyrelease_handler(GtkEntry *entry,
XtmProcessTreeView *treeview)
{
const gchar *text;
gchar *text;
gboolean has_text;
text = gtk_editable_get_chars (GTK_EDITABLE(entry), 0, -1);
xtm_process_tree_view_set_filter(treeview, text);
g_free (text);
has_text = gtk_entry_get_text_length (GTK_ENTRY(entry)) > 0;
gtk_entry_set_icon_sensitive (GTK_ENTRY(entry),