File tree 3 files changed +10
-5
lines changed
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -480,5 +480,12 @@ public NoDevicesException() : base("No devices to select")
480
480
}
481
481
482
482
#endregion
483
+
484
+ public void Dispose ( )
485
+ {
486
+ TrayIcon ? . Dispose ( ) ;
487
+ ActiveAudioDeviceLister ? . Dispose ( ) ;
488
+ ActiveUnpluggedAudioLister ? . Dispose ( ) ;
489
+ }
483
490
}
484
491
}
Original file line number Diff line number Diff line change 27
27
28
28
namespace SoundSwitch . Model
29
29
{
30
- public interface IAppModel
30
+ public interface IAppModel : IDisposable
31
31
{
32
32
#region Properties
33
33
Original file line number Diff line number Diff line change @@ -129,11 +129,9 @@ private static void Main()
129
129
HandleException ( ex ) ;
130
130
}
131
131
#endif
132
- AppModel . Instance . ActiveAudioDeviceLister . Dispose ( ) ;
133
- AppModel . Instance . ActiveUnpluggedAudioLister . Dispose ( ) ;
134
- AppModel . Instance . TrayIcon . Dispose ( ) ;
132
+ AppModel . Instance . Dispose ( ) ;
135
133
WindowsAPIAdapter . Stop ( ) ;
136
- MMNotificationClient . Instance . Dispose ( ) ;
134
+ MMNotificationClient . Instance ? . Dispose ( ) ;
137
135
Log . CloseAndFlush ( ) ;
138
136
}
139
137
You can’t perform that action at this time.
0 commit comments