diff --git a/gui/model.c b/gui/model.c index 8c6896c8..c68fb087 100644 --- a/gui/model.c +++ b/gui/model.c @@ -278,10 +278,15 @@ void gui_queue_model_remove(GuiQueueModel *model, unsigned int row) void gui_queue_model_clear(GuiQueueModel *model, unsigned int n) { + GtkTreePath *path = gtk_tree_path_new_from_indices(n - 1, -1); unsigned int i; - for (i = 1; i <= n; i++) - gui_queue_model_remove(model, n - i); + for (i = 0; i < n; i++) { + gtk_tree_model_row_deleted(GTK_TREE_MODEL(model), path); + gtk_tree_path_prev(path); + } + + gtk_tree_path_free(path); } void gui_queue_model_update(GuiQueueModel *model, unsigned int row)