Menu

#13 SaveAsXml improperly closes underlying stream

open
nobody
None
5
2009-06-05
2009-06-05
No

In DocPanel.Persistor.cs, method:
public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding, bool upstream)

if upstream is true, this method will close the stream; since it didn't open the stream, it shouldn't close it.

Change (line 355) :
if (!upstream)
{
xmlOut.WriteEndDocument();
xmlOut.Close();
}
else
xmlOut.Flush();
To:
if (!upstream)
{
xmlOut.WriteEndDocument();
}
xmlOut.Flush();

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.