diff --git a/LibationWinForms/Dialogs/RemoveBooksDialog.cs b/LibationWinForms/Dialogs/RemoveBooksDialog.cs index 139612c5..7496df2b 100644 --- a/LibationWinForms/Dialogs/RemoveBooksDialog.cs +++ b/LibationWinForms/Dialogs/RemoveBooksDialog.cs @@ -58,7 +58,7 @@ namespace LibationWinForms.Dialogs { var removedBooks = await LibraryCommands.FindInactiveBooks((account) => new WinformResponder(account), _libraryBooks, _accounts); - var removable = _removableGridEntries.Where(rge => removedBooks.Any(rb => rb.Book.AudibleProductId == rge.AudibleProductId)); + var removable = _removableGridEntries.Where(rge => removedBooks.Any(rb => rb.Book.AudibleProductId == rge.AudibleProductId)).ToList(); if (!removable.Any()) return; diff --git a/LibationWinForms/Form1.cs b/LibationWinForms/Form1.cs index deeebcae..b17befb9 100644 --- a/LibationWinForms/Form1.cs +++ b/LibationWinForms/Form1.cs @@ -151,7 +151,7 @@ namespace LibationWinForms { if (currProductsGrid != null) { - gridPanel.Controls.Remove(currProductsGrid); + gridPanel.UIThread(() => gridPanel.Controls.Remove(currProductsGrid)); currProductsGrid.VisibleCountChanged -= setVisibleCount; currProductsGrid.Dispose(); }