Skip to content

Commit 01372b1

Browse files
committed
* Fixed notifyicon remaining visible after the window was closed
1 parent a6939ca commit 01372b1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

MemPlus/Business/RAM/RamController.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace MemPlus.Business.RAM
1111
/// <summary>
1212
/// Sealed class containing methods and interaction logic in terms of RAM
1313
/// </summary>
14-
internal sealed class RamController
14+
internal sealed class RamController : IDisposable
1515
{
1616
#region Variables
1717
/// <summary>
@@ -366,5 +366,15 @@ private void UpdateRamUsage()
366366

367367
_logController.AddLog(new ApplicationLog("Finished updating RAM usage"));
368368
}
369+
370+
/// <inheritdoc />
371+
/// <summary>
372+
/// Dispose all disposable objects
373+
/// </summary>
374+
public void Dispose()
375+
{
376+
_ramTimer?.Dispose();
377+
_ramAutoOptimizeTimer?.Dispose();
378+
}
369379
}
370380
}

MemPlus/Views/Windows/MainWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,7 @@ private void MainWindow_OnClosing(object sender, CancelEventArgs e)
918918
_hotKeyController?.Dispose();
919919
// Disable the RAM Monitor to prevent exceptions from being thrown
920920
_ramController?.DisableMonitor();
921+
TbiIcon?.Dispose();
921922
}
922923
}
923924
}

0 commit comments

Comments
 (0)