Author: jonpryor
Date: 2008-01-03 15:16:29 -0500 (Thu, 03 Jan 2008)
New Revision: 92203

Modified:
   trunk/monodoc/tools/ChangeLog
   trunk/monodoc/tools/monodocer.cs
Log:
        * monodocer.cs: XmlNodeList doesn't appear to support removing nodes 
while
          you're traversing the list.  (It doesn't complain, but it doesn't 
iterate
          over all the nodes either if you do so.)  Don't do that.


Modified: trunk/monodoc/tools/ChangeLog
===================================================================
--- trunk/monodoc/tools/ChangeLog       2008-01-03 20:02:17 UTC (rev 92202)
+++ trunk/monodoc/tools/ChangeLog       2008-01-03 20:16:29 UTC (rev 92203)
@@ -1,3 +1,9 @@
+2008-01-03  Jonathan Pryor <[EMAIL PROTECTED]>
+
+       * monodocer.cs: XmlNodeList doesn't appear to support removing nodes 
while
+         you're traversing the list.  (It doesn't complain, but it doesn't 
iterate
+         over all the nodes either if you do so.)  Don't do that.
+
 2008-01-02  Jonathan Pryor <[EMAIL PROTECTED]>
 
        * monodocer.cs: Don't generate files that contain characters that are

Modified: trunk/monodoc/tools/monodocer.cs
===================================================================
--- trunk/monodoc/tools/monodocer.cs    2008-01-03 20:02:17 UTC (rev 92202)
+++ trunk/monodoc/tools/monodocer.cs    2008-01-03 20:16:29 UTC (rev 92203)
@@ -755,12 +755,15 @@
        private static void CleanupIndexTypes (XmlElement index_types, 
Hashtable goodfiles)
        {
                // Look for type nodes that no longer correspond to types
+               MyXmlNodeList remove = new MyXmlNodeList ();
                foreach (XmlElement typenode in 
index_types.SelectNodes("Namespace/Type")) {
                        string fulltypename = Path.Combine 
(((XmlElement)typenode.ParentNode).GetAttribute("Name"), 
typenode.GetAttribute("Name") + ".xml");
                        if (!goodfiles.ContainsKey(fulltypename)) {
-                               typenode.ParentNode.RemoveChild(typenode);
+                               remove.Add (typenode);
                        }
                }
+               foreach (XmlNode n in remove)
+                       n.ParentNode.RemoveChild (n);
        }
                
        public static void DoUpdateType2(string message, XmlDocument basefile, 
Type type, string output, bool insertSince, XmlReader ecmaDocsType) {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to