From f3f90691e614f6819073c10ce688fe838b80e1cc Mon Sep 17 00:00:00 2001 From: Jarl Gullberg Date: Mon, 29 May 2017 18:15:49 +0200 Subject: [PATCH] Changed manual stream closing to a using statement. --- src/Generator.Rewrite/Program.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Generator.Rewrite/Program.cs b/src/Generator.Rewrite/Program.cs index 11198144..13002edd 100644 --- a/src/Generator.Rewrite/Program.cs +++ b/src/Generator.Rewrite/Program.cs @@ -77,10 +77,12 @@ namespace OpenTK.Rewrite if (!String.IsNullOrEmpty(keyfile) && File.Exists(keyfile)) { keyfile = Path.GetFullPath(keyfile); - var fs = new FileStream(keyfile, FileMode.Open, FileAccess.Read); - var keypair = new System.Reflection.StrongNameKeyPair(fs); - fs.Close(); - write_params.StrongNameKeyPair = keypair; + + using (var fs = new FileStream(keyfile, FileMode.Open, FileAccess.Read)) + { + var keypair = new System.Reflection.StrongNameKeyPair(fs); + write_params.StrongNameKeyPair = keypair; + } } else {