Close xmlwriter first
This commit is contained in:
parent
6ee04855cd
commit
d69870680b
|
@ -257,6 +257,8 @@ namespace Emby.Dlna.ContentDirectory
|
|||
|
||||
int totalCount;
|
||||
|
||||
using (StringWriter builder = new StringWriterWithEncoding(Encoding.UTF8))
|
||||
{
|
||||
var settings = new XmlWriterSettings()
|
||||
{
|
||||
Encoding = Encoding.UTF8,
|
||||
|
@ -265,7 +267,6 @@ namespace Emby.Dlna.ContentDirectory
|
|||
ConformanceLevel = ConformanceLevel.Fragment
|
||||
};
|
||||
|
||||
using (StringWriter builder = new StringWriterWithEncoding(Encoding.UTF8))
|
||||
using (var writer = XmlWriter.Create(builder, settings))
|
||||
{
|
||||
writer.WriteStartElement(string.Empty, "DIDL-Lite", NS_DIDL);
|
||||
|
@ -326,6 +327,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
}
|
||||
|
||||
writer.WriteFullEndElement();
|
||||
}
|
||||
|
||||
xmlWriter.WriteElementString("Result", builder.ToString());
|
||||
}
|
||||
|
@ -366,6 +368,8 @@ namespace Emby.Dlna.ContentDirectory
|
|||
|
||||
QueryResult<BaseItem> childrenResult;
|
||||
|
||||
using (StringWriter builder = new StringWriterWithEncoding(Encoding.UTF8))
|
||||
{
|
||||
var settings = new XmlWriterSettings()
|
||||
{
|
||||
Encoding = Encoding.UTF8,
|
||||
|
@ -374,7 +378,6 @@ namespace Emby.Dlna.ContentDirectory
|
|||
ConformanceLevel = ConformanceLevel.Fragment
|
||||
};
|
||||
|
||||
using (StringWriter builder = new StringWriterWithEncoding(Encoding.UTF8))
|
||||
using (var writer = XmlWriter.Create(builder, settings))
|
||||
{
|
||||
writer.WriteStartElement(string.Empty, "DIDL-Lite", NS_DIDL);
|
||||
|
@ -409,6 +412,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
}
|
||||
|
||||
writer.WriteFullEndElement();
|
||||
}
|
||||
|
||||
xmlWriter.WriteElementString("Result", builder.ToString());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user