(Maybe?) fixed "collection was modified" exceptions in GUIComponent.AddToGUIUpdateList
http://undertowgames.com/forum/viewtopic.php?f=21&t=5915 Couldn't reproduce the exception and not sure why exactly it happens, but I think this should prevent it
This commit is contained in:
@@ -28,7 +28,12 @@ namespace Barotrauma
|
|||||||
if (!Visible) return;
|
if (!Visible) return;
|
||||||
if (ComponentsToUpdate.Contains(this)) return;
|
if (ComponentsToUpdate.Contains(this)) return;
|
||||||
ComponentsToUpdate.Add(this);
|
ComponentsToUpdate.Add(this);
|
||||||
children.ForEach(c => c.AddToGUIUpdateList());
|
|
||||||
|
List<GUIComponent> fixedChildren = new List<GUIComponent>(children);
|
||||||
|
foreach (GUIComponent c in fixedChildren)
|
||||||
|
{
|
||||||
|
c.AddToGUIUpdateList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ClearUpdateList()
|
public static void ClearUpdateList()
|
||||||
|
|||||||
Reference in New Issue
Block a user