Ignore:
Timestamp:
11/23/18 15:37:24 (2 years ago)
Author:
pfleck
Message:

#2965

  • Added CancelationTokens for the Save and Serialize methods.
  • Fixed a potential temp-file-leak when replacing the old file with the new one after serialization.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2965_CancelablePersistence/HeuristicLab.Core/3.3/PersistenceContentManager.cs

    r15583 r16325  
    2121
    2222using System.IO.Compression;
     23using System.Threading;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Persistence.Default.Xml;
     
    3233    }
    3334
    34     protected override void SaveContent(IStorableContent content, string filename, bool compressed) {
    35       XmlGenerator.Serialize(content, filename, compressed ? CompressionLevel.Optimal : CompressionLevel.NoCompression);
     35    protected override void SaveContent(IStorableContent content, string filename, bool compressed, CancellationToken cancellationToken) {
     36      XmlGenerator.Serialize(content, filename, compressed ? CompressionLevel.Optimal : CompressionLevel.NoCompression, cancellationToken);
    3637    }
    3738  }
Note: See TracChangeset for help on using the changeset viewer.