Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/26/10 15:47:53 (15 years ago)
Author:
epitzer
Message:

Add using around ZipFile to prevent a locked file in case of a deserialization exception (#548)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs

    r1823 r2874  
    123123
    124124    public static object Deserialize(string filename) {
    125       return Deserialize(new ZipFile(filename));
     125      using (ZipFile file = new ZipFile(filename)) {
     126        return Deserialize(file);
     127      }
    126128    }
    127129
    128130    public static object Deserialize(Stream stream) {
    129       return Deserialize(new ZipFile(stream));
     131      using (ZipFile file = new ZipFile(stream)) {
     132        return Deserialize(file);
     133      }
    130134    }
    131135
Note: See TracChangeset for help on using the changeset viewer.