2010-04-10 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Sat, 10 Apr 2010 19:39:00 +0000 (19:39 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Sat, 10 Apr 2010 19:39:00 +0000 (19:39 -0000)
* XamlXmlWriter.cs : Process closing only once (disposing).
  Close output only when required.

svn path=/trunk/mcs/; revision=155206

mcs/class/System.Xaml/System.Xaml/ChangeLog
mcs/class/System.Xaml/System.Xaml/XamlXmlWriter.cs

index 1b6dc8f488e4f826a15169b75e2e821072db318a..6774faf8bea0db41e7f07a889beb8955e8944e9c 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-10  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * XamlXmlWriter.cs : Process closing only once (disposing).
+         Close output only when required.
+
 2010-04-10  Atsushi Enomoto  <atsushi@ximian.com>
 
        * TypeExtensionMethods.cs, XamlType.cs :
index 4d0183f4d89a3972e2bc36fdfc0c2cba266697df..b6a0c0b88d6f5ae317aa98c9c784aeaf1d37d383 100644 (file)
@@ -141,6 +141,9 @@ namespace System.Xaml
 
                protected override void Dispose (bool disposing)
                {
+                       if (!disposing)
+                               return;
+
                        while (nodes.Count > 0) {
                                var obj = nodes.Peek ();
                                if (obj is XamlMember) {
@@ -154,7 +157,7 @@ namespace System.Xaml
                                else
                                        nodes.Pop ();
                        }
-                       if (disposing)
+                       if (settings.CloseOutput)
                                w.Close ();
                }