Changeset 13445


Ignore:
Timestamp:
12/09/15 10:48:22 (5 years ago)
Author:
gkronber
Message:

#2071: corrected disposal of StreamReader

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TableFileParser.cs

    r13442 r13445  
    142142      var len = new System.IO.FileInfo(fileName).Length;
    143143      var buf = new char[64 * 1024];
    144       var reader = new StreamReader(File.OpenRead(fileName));
    145       reader.ReadBlock(buf, 0, buf.Length);
     144      using(var reader = new StreamReader(fileName)) {
     145        reader.ReadBlock(buf, 0, buf.Length);
     146      }
    146147      int numNewLine = 0;
    147148      int charsInCurrentLine = 0, charsInFirstLine = 0; // the first line (names) and the last line (incomplete) are not representative
Note: See TracChangeset for help on using the changeset viewer.