diff --git a/sample/gtk-html-sample.cs b/sample/gtk-html-sample.cs index 723e11349..b594503c7 100644 --- a/sample/gtk-html-sample.cs +++ b/sample/gtk-html-sample.cs @@ -14,9 +14,9 @@ class HTMLSample { win.Add (html); HTMLStream s = html.Begin ("text/html"); - if (args.Length > 0){ - StreamReader r = new StreamReader (File.OpenRead (args [0])); - s.Write (r.ReadToEnd ()); + if (args.Length > 0) { + using (StreamReader r = File.OpenText (args [0])) + s.Write (r.ReadToEnd ()); } else { s.Write (""); s.Write ("Hello world!");