Move file stream dispose

This commit is contained in:
Mark J Price 2022-07-05 18:59:10 +01:00
parent b90eb4fd32
commit 95dbd59fcd
2 changed files with 10 additions and 10 deletions

View file

@ -75,13 +75,13 @@ finally
{ {
xml.Dispose(); xml.Dispose();
WriteLine("The XML writer's unmanaged resources have been disposed."); WriteLine("The XML writer's unmanaged resources have been disposed.");
}
if (xmlFileStream != null) if (xmlFileStream != null)
{ {
xmlFileStream.Dispose(); xmlFileStream.Dispose();
WriteLine("The file stream's unmanaged resources have been disposed."); WriteLine("The file stream's unmanaged resources have been disposed.");
} }
} }
}
// output all the contents of the file // output all the contents of the file
WriteLine("{0} contains {1:N0} bytes.", WriteLine("{0} contains {1:N0} bytes.",

View file

@ -75,13 +75,13 @@ finally
{ {
xml.Dispose(); xml.Dispose();
WriteLine("The XML writer's unmanaged resources have been disposed."); WriteLine("The XML writer's unmanaged resources have been disposed.");
}
if (xmlFileStream != null) if (xmlFileStream != null)
{ {
xmlFileStream.Dispose(); xmlFileStream.Dispose();
WriteLine("The file stream's unmanaged resources have been disposed."); WriteLine("The file stream's unmanaged resources have been disposed.");
} }
} }
}
// output all the contents of the file // output all the contents of the file
WriteLine("{0} contains {1:N0} bytes.", WriteLine("{0} contains {1:N0} bytes.",