File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,6 @@ public void SaveCSV(StreamWriter outputFile)
308
308
ScottPlot . WinForms . FormsPlot PlotG ;
309
309
/// <value>Table for all loaded Attributes of the TRA-File</value>
310
310
DataGridView gridView ;
311
-
312
311
public void Plot ( )
313
312
{
314
313
if ( Form == null )
@@ -358,9 +357,9 @@ public void Plot()
358
357
BtnPanel . Controls . Add ( CheckElementLabels ) ;
359
358
BtnPanel . Controls . Add ( CheckShowWarnings ) ;
360
359
BtnPanel . Controls . Add ( CheckProjections ) ;
361
- splitContainer . Panel2 . Controls . Add ( tabControl ) ;
362
-
360
+ splitContainer . Panel2 . Controls . Add ( tabControl ) ;
363
361
}
362
+ Form . FormClosing += ( sender , e ) => OnFormClosed ( ) ;
364
363
//Add Plot for 2D overview
365
364
PixelPadding padding = new ( 80 , 80 , 20 , 5 ) ;
366
365
if ( Plot2D == null )
@@ -591,6 +590,15 @@ public void Plot()
591
590
Form . Update ( ) ;
592
591
}
593
592
593
+ private void OnFormClosed ( )
594
+ {
595
+ Plottables . Clear ( ) ;
596
+ selectedS = null ; PlotT = null ; PlotG = null ;
597
+ gridView = null ;
598
+ Plot2D = null ;
599
+ Form = null ;
600
+ }
601
+
594
602
public void UpdatePlot ( )
595
603
{
596
604
if ( gridView != null )
@@ -604,7 +612,8 @@ public void UpdatePlot()
604
612
605
613
}
606
614
private void Warning_CollectionChanged ( object sender , NotifyCollectionChangedEventArgs e )
607
- {
615
+ {
616
+ if ( Plot2D == null ) return ;
608
617
switch ( e . Action )
609
618
{
610
619
case NotifyCollectionChangedAction . Add :
You can’t perform that action at this time.
0 commit comments