Skip to content

Commit

Permalink
Clear items from Dispose()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Jangli authored and Jeffrey Jangli committed Oct 21, 2023
1 parent cde2807 commit 83ed42a
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace MudExtensions
{
public partial class MudComboBox<T> : MudBaseInputExtended<T>, IDisposable
public partial class MudComboBox<T> : MudBaseInputExtended<T>
{
#region Constructor, Injected Services, Parameters, Fields

Expand Down Expand Up @@ -740,8 +740,11 @@ protected override void Dispose(bool disposing)
{
_keyInterceptor.KeyDown -= HandleKeyDown;
_keyInterceptor.KeyUp -= HandleKeyUp;
_keyInterceptor.Dispose();
_keyInterceptor = null;
}
_keyInterceptor?.Dispose();

Items.Clear();
}
}

Expand Down Expand Up @@ -1419,11 +1422,5 @@ protected Typo GetTypo()

protected internal ValueTask ScrollToMiddleAsync(MudComboBoxItem<T> item) =>
item is not null ? ScrollManagerExtended.ScrollToMiddleAsync(_popoverId, item.ItemId) : ValueTask.CompletedTask;


public void Dispose()
{
Items.Clear();
}
}
}

0 comments on commit 83ed42a

Please sign in to comment.