File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3+ using System . ComponentModel ;
34using System . Linq ;
45using System . Windows ;
56using System . Windows . Controls ;
Original file line number Diff line number Diff line change 99 mc : Ignorable =" d"
1010 UseLayoutRounding =" True"
1111 TitleTextAlignment =" Center"
12+ Closing =" MainWindow_OnClosing"
1213 Title =" MemPlus" Height =" 300" Width =" 500" WindowStartupLocation =" CenterScreen" Icon =" /Resources/Images/ram.png" >
1314 <Grid >
1415 <Grid .RowDefinitions>
Original file line number Diff line number Diff line change 11using System ;
2+ using System . ComponentModel ;
23using System . Reflection ;
34using System . Windows ;
45using System . Windows . Input ;
@@ -738,5 +739,16 @@ private async void ClearMemory(int index)
738739 _clearingMemory = false ;
739740 _logController . AddLog ( new ApplicationLog ( "Done clearing RAM memory" ) ) ;
740741 }
742+
743+ /// <summary>
744+ /// Method that is called when the MainWindow is closing
745+ /// </summary>
746+ /// <param name="sender">The object that called this method</param>
747+ /// <param name="e">The CancelEventArgs</param>
748+ private void MainWindow_OnClosing ( object sender , CancelEventArgs e )
749+ {
750+ // Disable the RAM Monitor to prevent exceptions from being thrown
751+ _ramController ? . DisableMonitor ( ) ;
752+ }
741753 }
742754}
You can’t perform that action at this time.
0 commit comments