Skip to content

Commit

Permalink
fix for occasional crash related to thera updates during a refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
BitBaboonSteve committed Sep 1, 2024
1 parent a58f759 commit ca15a65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions SMT/RegionControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ public void AddTheraSystemsToMap()
{
Brush TheraBrush = new SolidColorBrush(MapConf.ActiveColourScheme.TheraEntranceSystem);

foreach (TheraConnection tc in EM.TheraConnections)
List<TheraConnection> currentTheraConnections = EM.TheraConnections.ToList();

foreach (TheraConnection tc in currentTheraConnections)
{
if (Region.IsSystemOnMap(tc.System))
{
Expand Down Expand Up @@ -3693,8 +3695,9 @@ private void ShapeMouseOverHandler(object sender, MouseEventArgs e)
SystemInfoPopupSP.Children.Add(sov);
}

List<TheraConnection> currentTheraConnections = EM.TheraConnections.ToList();
// update Thera Info
foreach (EVEData.TheraConnection tc in EM.TheraConnections)
foreach (EVEData.TheraConnection tc in currentTheraConnections)
{
if (selectedSys.Name == tc.System)
{
Expand Down
8 changes: 6 additions & 2 deletions SMT/RegionsViewControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Shapes;
using SMT.EVEData;

namespace SMT
{
Expand Down Expand Up @@ -217,7 +218,8 @@ private void RegionThera_ShapeMouseOverHandler(object sender, MouseEventArgs e)
header.Padding = new Thickness(1);
RegionTheraInfoSP.Children.Add(header);

foreach (EVEData.TheraConnection tc in EVEData.EveManager.Instance.TheraConnections)
List<TheraConnection> currentTheraConnections = EVEData.EveManager.Instance.TheraConnections.ToList();
foreach (EVEData.TheraConnection tc in currentTheraConnections)
{
if (string.Compare(tc.Region, selectedRegion.Name, true) == 0)
{
Expand Down Expand Up @@ -247,10 +249,12 @@ private void AddDataToUniverse()
Brush theraBrush = new SolidColorBrush(MapConf.ActiveColourScheme.TheraEntranceRegion);
Brush characterBrush = new SolidColorBrush(MapConf.ActiveColourScheme.CharacterHighlightColour);

List<TheraConnection> currentTheraConnections = EVEData.EveManager.Instance.TheraConnections.ToList();

foreach (EVEData.MapRegion mr in EVEData.EveManager.Instance.Regions)
{
bool addTheraConnection = false;
foreach (EVEData.TheraConnection tc in EVEData.EveManager.Instance.TheraConnections)
foreach (EVEData.TheraConnection tc in currentTheraConnections)
{
if (string.Compare(tc.Region, mr.Name, true) == 0)
{
Expand Down

0 comments on commit ca15a65

Please sign in to comment.