changeset 126:d5fec0698026

Fixes #113: XML loader doesn't close stream * Close stream after XML loading to allow re-saving file
author IBBoard <dev@ibboard.co.uk>
date Mon, 24 Aug 2009 21:20:36 +0000
parents c60fd5664698
children b04512847424
files api/Factories/Xml/WarFoundryXmlFactory.cs
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/api/Factories/Xml/WarFoundryXmlFactory.cs	Mon Aug 24 21:12:18 2009 +0000
     1.2 +++ b/api/Factories/Xml/WarFoundryXmlFactory.cs	Mon Aug 24 21:20:36 2009 +0000
     1.3 @@ -75,7 +75,8 @@
     1.4  		
     1.5  		private XmlElement GetRootElementFromStream(Stream stream, WarFoundryXmlElementName elementName)
     1.6  		{
     1.7 -			XmlDocument doc = WarFoundryXmlFactoryUtils.CreateXmlDocumentFromStream(stream);			
     1.8 +			XmlDocument doc = WarFoundryXmlFactoryUtils.CreateXmlDocumentFromStream(stream);
     1.9 +			stream.Close();
    1.10  			XmlElement elem = (XmlElement)doc.LastChild;
    1.11  			
    1.12  			if (!elem.LocalName.Equals(elementName.Value))