From b4912017edcbbac6614d69307a5fe35ce6000bef Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 11 Nov 2014 21:37:56 +0000 Subject: [PATCH] added in disposing of objects for memory management --- Saviour Backup System/notificationIcon.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Saviour Backup System/notificationIcon.cs b/Saviour Backup System/notificationIcon.cs index 7dc188f..07eec00 100644 --- a/Saviour Backup System/notificationIcon.cs +++ b/Saviour Backup System/notificationIcon.cs @@ -7,7 +7,7 @@ using System.Windows.Forms; namespace Saviour_Backup_System { - class notificationIcon + class notificationIcon : IDisposable { internal NotifyIcon notifyIcon = new NotifyIcon() ; internal ContextMenu contextMenu = new ContextMenu(); @@ -35,5 +35,10 @@ namespace Saviour_Backup_System internal void displayStillRunning() { } + public void Dispose()//deconstructor - for memory management + { + notifyIcon.Dispose(); + contextMenu.Dispose(); + } } }