@@ -34,7 +34,7 @@ internal class SagiriModel : BindableBase, IDisposable
34
34
private ISpotifyService _ISpotifyService { get ; init ; } = new SpotifyService ( ) ;
35
35
private IMisskeyService _IMisskeyService { get ; init ; } = new MisskeyService ( ) ;
36
36
37
- private Logger _Logger { get ; init ; } = Logger . GetInstance ;
37
+ private Logger _Logger { get ; set ; } = Logger . GetInstance ;
38
38
39
39
private static Lazy < HttpClient > _Client { get ; set ; } = new ( ) ;
40
40
private CancellationTokenSource _CancellationSource { get ; init ; } = new ( ) ;
@@ -65,9 +65,16 @@ internal SagiriModel() { }
65
65
66
66
public void Dispose ( )
67
67
{
68
+ _ISpotifyService ? . Dispose ( ) ;
69
+ _IMisskeyService ? . Dispose ( ) ;
70
+
68
71
CurrentTrackInfo . AddTo ( _cd ) ;
69
72
IsSpotifyPlaying . AddTo ( _cd ) ;
73
+ PostingFormat . AddTo ( _cd ) ;
70
74
_cd . Dispose ( ) ;
75
+
76
+ _CancellationSource ? . Dispose ( ) ;
77
+ _Logger = null ;
71
78
}
72
79
73
80
#endregion Public Methods
@@ -258,7 +265,7 @@ private void _OnSpotifyCurrentTrackErrorDetected()
258
265
MessageBox . Show ( "Spotify CurrentTrackError..." , "Sagiri-NowPlaying Closed..." ) ;
259
266
_Logger . WriteLog ( "Spotify CurrentTrackError..." , Logger . LogLevel . Error ) ;
260
267
261
- _ISpotifyService . Dispose ( ) ;
268
+ _ISpotifyService ? . Dispose ( ) ;
262
269
}
263
270
264
271
private void _NotifyErrorCredentialInfo ( string errorType , string title , string message = "" )
0 commit comments