Mercurial > repos > IBBoard.WarFoundry.API
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 wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlFactory.cs Mon Aug 24 21:12:18 2009 +0000 +++ b/api/Factories/Xml/WarFoundryXmlFactory.cs Mon Aug 24 21:20:36 2009 +0000 @@ -75,7 +75,8 @@ private XmlElement GetRootElementFromStream(Stream stream, WarFoundryXmlElementName elementName) { - XmlDocument doc = WarFoundryXmlFactoryUtils.CreateXmlDocumentFromStream(stream); + XmlDocument doc = WarFoundryXmlFactoryUtils.CreateXmlDocumentFromStream(stream); + stream.Close(); XmlElement elem = (XmlElement)doc.LastChild; if (!elem.LocalName.Equals(elementName.Value))