[Mono-bugs] [Bug 60800][Maj] Changed - Controls.Clear() prevents re-adding controls

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 27 Jun 2004 00:59:15 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by andrewarnott@byu.edu.

http://bugzilla.ximian.com/show_bug.cgi?id=60800

--- shadow/60800	2004-06-27 00:55:45.000000000 -0400
+++ shadow/60800.tmp.26402	2004-06-27 00:59:15.000000000 -0400
@@ -1,12 +1,12 @@
 Bug#: 60800
 Product: Mono: Class Libraries
 Version: unspecified
 OS: SUSE 9.0
 OS Details: 
-Status: ASSIGNED   
+Status: NEW   
 Resolution: 
 Severity: Unknown
 Priority: Major
 Component: Sys.Web
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: AndrewArnott@byu.edu               
@@ -60,6 +60,18 @@
 within a few minutes.
 
 ------- Additional Comments From AndrewArnott@byu.edu  2004-06-27 00:55 -------
 Created an attachment (id=8366)
 Proposed patch
 
+
+------- Additional Comments From AndrewArnott@byu.edu  2004-06-27 00:59 -------
+The problem was that when ControlCollection.Clear() is called, all the
+controls are freed from the collection, but each of the controls still
+had references to having a parent Control.  When they were added
+again, the AddedControl event reversed the add operation because it
+thought that the control already had a parent.  
+
+The Remove and RemoveAt methods for ControlCollection correctly call
+RemovedControl for each control being removed so that this error did
+not occur.  The solution is to have Clear() call RemovedControl for
+each control before actually clearing the collection.