Fix a leak searching for the keybinding group row

This commit is contained in:
Colomban Wendling 2013-06-01 01:56:31 +02:00
parent 44fcdf1b7c
commit d3b88fb5b1

View File

@ -339,19 +339,23 @@ void prefs_kb_search_name(const gchar *search)
GtkTreeIter iter;
gboolean valid;
GtkTreeModel *model;
gchar *name;
model = gtk_tree_view_get_model(tree);
valid = gtk_tree_model_get_iter_first(model, &iter);
while (valid)
{
gchar *name;
gtk_tree_model_get(model, &iter, KB_TREE_ACTION, &name, -1);
if(g_strcmp0(name, search) == 0)
if (g_strcmp0(name, search) == 0)
{
GtkTreePath *path = gtk_tree_model_get_path(model, &iter);
gtk_tree_view_scroll_to_cell(tree, path, NULL, FALSE, .0f, .0f);
gtk_tree_path_free(path);
g_free(name);
break;
}
g_free(name);
valid = gtk_tree_model_iter_next(model, &iter);
}
}