Changeset 687 for trunk/sources
- Timestamp:
- 10/19/08 00:27:45 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/PersistenceManager.cs
r402 r687 65 65 } 66 66 public static void Save(IStorable instance, string filename) { 67 FileStream stream = File.Create(filename); 68 Save(instance, stream); 69 stream.Close(); 67 using(FileStream stream = File.Create(filename)) { 68 Save(instance, stream); 69 stream.Close(); 70 } 70 71 } 71 72 public static void Save(IStorable instance, Stream stream) { … … 76 77 } 77 78 public static IStorable Load(string filename) { 78 FileStream stream = File.OpenRead(filename); 79 IStorable storable = Load(stream); 80 stream.Close(); 81 return storable; 79 using(FileStream stream = File.OpenRead(filename)) { 80 IStorable storable = Load(stream); 81 stream.Close(); 82 return storable; 83 } 82 84 } 83 85 public static IStorable Load(Stream stream) {
Note: See TracChangeset
for help on using the changeset viewer.