Fixed memory leak issue with song image source not getting disposed. Added playbackbar configuration button.
This commit is contained in:
@@ -16,7 +16,7 @@ using System.Windows.Input;
|
||||
|
||||
namespace Harmonia.UI.ViewModels;
|
||||
|
||||
public partial class PlaybackBarViewModel : ViewModelBase
|
||||
public partial class PlaybackBarViewModel : ViewModelBase, IDisposable
|
||||
{
|
||||
private readonly IAudioPlayer _audioPlayer;
|
||||
private readonly IAudioImageCache _audioImageCache;
|
||||
@@ -52,6 +52,7 @@ public partial class PlaybackBarViewModel : ViewModelBase
|
||||
}
|
||||
private set
|
||||
{
|
||||
_songImageSource?.Dispose();
|
||||
_songImageSource = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
@@ -217,4 +218,10 @@ public partial class PlaybackBarViewModel : ViewModelBase
|
||||
{
|
||||
_audioPlayer.NextAsync();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
SongImageSource?.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user