diff options
author | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2015-06-15 18:16:02 +0300 |
---|---|---|
committer | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2015-06-15 18:36:53 +0300 |
commit | d8960f7afe0c41137e5c214c990f99189d57df3b (patch) | |
tree | a0f17ee61912892055705e90afca6bc93d941f12 /main/src/addins/MonoDevelop.Autotools | |
parent | 3496b3676e405b33671933d42a02f2e00bbd1fb5 (diff) |
[AutoTools] Fix leak in streams.
CID 114616
Diffstat (limited to 'main/src/addins/MonoDevelop.Autotools')
-rw-r--r-- | main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs b/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs index 3bb43a271b..c8388d61c5 100644 --- a/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs +++ b/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs @@ -261,15 +261,11 @@ namespace MonoDevelop.Autotools string fileName = Path.Combine (solution_dir, "autogen.sh"); - StreamWriter writer = new StreamWriter( fileName ); - - Stream stream = context.GetTemplateStream ("autogen.sh.template"); - StreamReader reader = new StreamReader(stream); - - templateEngine.Process(reader, writer); - - reader.Close(); - writer.Close(); + using (StreamWriter writer = new StreamWriter( fileName )) + using (Stream stream = context.GetTemplateStream ("autogen.sh.template")) + using (StreamReader reader = new StreamReader (stream)) { + templateEngine.Process (reader, writer); + } context.AddGeneratedFile (fileName); |