Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Ungureanu <marius.ungureanu@xamarin.com>2016-09-18 04:21:38 +0300
committerMarius Ungureanu <marius.ungureanu@xamarin.com>2016-09-18 04:21:38 +0300
commit5a3dfeb4aef32481f942eaa509f464006334367e (patch)
tree4d0bd1899c2a1a006a7da99bb037fe92254530e6 /main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook
parent3d8599fd37f91be6bc104faff54d99e6132f4b08 (diff)
[Ide] Avoid creating a new array for the tabstrip.
In this case, we will have an array created for a Widget that might live very long, so every time the ForAll callback is called, the widget will stay alive. Iterate via for i=1..count, so we don't end up having memory problems.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
index 62874505e5..7928c266a8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
@@ -256,8 +256,8 @@ namespace MonoDevelop.Components.DockNotebook
protected override void ForAll (bool include_internals, Callback callback)
{
base.ForAll (include_internals, callback);
- foreach (var c in children.ToArray ())
- callback (c);
+ for (int i = 0; i < children.Count; ++i)
+ callback (children [i]);
}
protected override void OnRemoved (Widget widget)