Fixed cross thread bug and Enumerable change bug.

This commit is contained in:
Mbucari 2021-09-02 21:04:16 -06:00
parent 6ed1307443
commit 1040a347c6
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ namespace LibationWinForms.Dialogs
{ {
var removedBooks = await LibraryCommands.FindInactiveBooks((account) => new WinformResponder(account), _libraryBooks, _accounts); 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()) if (!removable.Any())
return; return;

View File

@ -151,7 +151,7 @@ namespace LibationWinForms
{ {
if (currProductsGrid != null) if (currProductsGrid != null)
{ {
gridPanel.Controls.Remove(currProductsGrid); gridPanel.UIThread(() => gridPanel.Controls.Remove(currProductsGrid));
currProductsGrid.VisibleCountChanged -= setVisibleCount; currProductsGrid.VisibleCountChanged -= setVisibleCount;
currProductsGrid.Dispose(); currProductsGrid.Dispose();
} }