mirror of
https://github.com/MistWeatherMedia/i2ME.git
synced 2026-11-28 22:30:55 -08:00
Close reader after getting the inner XML from the file
This commit is contained in:
1 parent
7f8eabafb8
commit
fd431b11c5
1 file changed
+6
-2
@@ -45,7 +45,8 @@ public class Base
|
||||
{
|
||||
XDocument doc = XDocument.Parse(content);
|
||||
XElement? root = doc.Root;
|
||||
|
||||
string innerXml;
|
||||
|
||||
if (root == null)
|
||||
{
|
||||
return String.Empty;
|
||||
@@ -54,7 +55,10 @@ public class Base
|
||||
XmlReader reader = root.CreateReader();
|
||||
reader.MoveToContent();
|
||||
|
||||
return reader.ReadInnerXml();
|
||||
innerXml = reader.ReadInnerXml();
|
||||
reader.Close();
|
||||
|
||||
return innerXml;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user