Skip to content

Commit d092b17

Browse files
committed
Clear lists of variables on close to prevent loading on closed windows
1 parent 48fba16 commit d092b17

File tree

6 files changed

+33
-0
lines changed

6 files changed

+33
-0
lines changed

solution/GraphicalDebugging/GeometryWatch.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,11 @@ public GeometryWatch() : base(null)
3636
// the object returned by the Content property.
3737
this.Content = new GeometryWatchControl();
3838
}
39+
40+
protected override void OnClose()
41+
{
42+
(this.Content as GeometryWatchControl).OnClose();
43+
base.OnClose();
44+
}
3945
}
4046
}

solution/GraphicalDebugging/GeometryWatchControl.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,5 +563,10 @@ private void dataGridContextMenuDisable_Click(object sender, RoutedEventArgs e)
563563
Util.EnableDataGridItems(dataGrid, Geometries,
564564
(GeometryItem geometry) => geometry.IsEnabled = false);
565565
}
566+
567+
public void OnClose()
568+
{
569+
Geometries.Clear();
570+
}
566571
}
567572
}

solution/GraphicalDebugging/GraphicalWatch.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,11 @@ public GraphicalWatch() : base(null)
3636
// the object returned by the Content property.
3737
this.Content = new GraphicalWatchControl();
3838
}
39+
40+
protected override void OnClose()
41+
{
42+
(this.Content as GraphicalWatchControl).OnClose();
43+
base.OnClose();
44+
}
3945
}
4046
}

solution/GraphicalDebugging/GraphicalWatchControl.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,5 +280,10 @@ private void dataGridContextMenuDelete_Click(object sender, RoutedEventArgs e)
280280
(GraphicalItem variable) => { },
281281
() => { });
282282
}
283+
284+
public void OnClose()
285+
{
286+
Variables.Clear();
287+
}
283288
}
284289
}

solution/GraphicalDebugging/PlotWatch.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,11 @@ public PlotWatch() : base(null)
3636
// the object returned by the Content property.
3737
this.Content = new PlotWatchControl();
3838
}
39+
40+
protected override void OnClose()
41+
{
42+
(this.Content as PlotWatchControl).OnClose();
43+
base.OnClose();
44+
}
3945
}
4046
}

solution/GraphicalDebugging/PlotWatchControl.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,5 +571,10 @@ private void dataGridContextMenuDisable_Click(object sender, RoutedEventArgs e)
571571
Util.EnableDataGridItems(dataGrid, Plots,
572572
(PlotItem plot) => plot.IsEnabled = false);
573573
}
574+
575+
public void OnClose()
576+
{
577+
Plots.Clear();
578+
}
574579
}
575580
}

0 commit comments

Comments
 (0)