From 95dbd59fcd195018bb43b32d82a84c631e75771c Mon Sep 17 00:00:00 2001 From: Mark J Price Date: Tue, 5 Jul 2022 18:59:10 +0100 Subject: [PATCH] Move file stream dispose --- vs4win/Chapter09/WorkingWithStreams/Program.cs | 10 +++++----- vscode/Chapter09/WorkingWithStreams/Program.cs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/vs4win/Chapter09/WorkingWithStreams/Program.cs b/vs4win/Chapter09/WorkingWithStreams/Program.cs index 695536f..d77b53c 100644 --- a/vs4win/Chapter09/WorkingWithStreams/Program.cs +++ b/vs4win/Chapter09/WorkingWithStreams/Program.cs @@ -75,11 +75,11 @@ finally { xml.Dispose(); WriteLine("The XML writer's unmanaged resources have been disposed."); - if (xmlFileStream != null) - { - xmlFileStream.Dispose(); - WriteLine("The file stream's unmanaged resources have been disposed."); - } + } + if (xmlFileStream != null) + { + xmlFileStream.Dispose(); + WriteLine("The file stream's unmanaged resources have been disposed."); } } diff --git a/vscode/Chapter09/WorkingWithStreams/Program.cs b/vscode/Chapter09/WorkingWithStreams/Program.cs index 695536f..d77b53c 100644 --- a/vscode/Chapter09/WorkingWithStreams/Program.cs +++ b/vscode/Chapter09/WorkingWithStreams/Program.cs @@ -75,11 +75,11 @@ finally { xml.Dispose(); WriteLine("The XML writer's unmanaged resources have been disposed."); - if (xmlFileStream != null) - { - xmlFileStream.Dispose(); - WriteLine("The file stream's unmanaged resources have been disposed."); - } + } + if (xmlFileStream != null) + { + xmlFileStream.Dispose(); + WriteLine("The file stream's unmanaged resources have been disposed."); } }