From a95ebec0f2543c108eac7c259d71ce90d4557132 Mon Sep 17 00:00:00 2001 From: Lluis Sanchez Date: Tue, 11 May 2010 09:01:23 +0000 Subject: * MonoDevelop.Components.Docking/DockGroup.cs: In RestoreAllocation, make a copy of the items list because RestoreAllocation can fire events such as VisibleChanged, and subscribers may do changes in the list. Should fix bug #600869 - Exception while switching layout from 'Solution' to 'Default' using the tool bar. svn path=/trunk/monodevelop/; revision=157100 --- .../MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking') diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs index abc72d3b47..2dfc4ef7ca 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs @@ -314,7 +314,11 @@ namespace MonoDevelop.Components.Docking { base.RestoreAllocation (); allocStatus = Size >= 0 ? AllocStatus.RestorePending : AllocStatus.NotSet; - foreach (DockObject ob in dockObjects) + + // Make a copy because RestoreAllocation can fire events such as VisibleChanged, + // and subscribers may do changes in the list. + List copy = new List (dockObjects); + foreach (DockObject ob in copy) ob.RestoreAllocation (); } -- cgit v1.2.3