Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/06/10 16:59:13 (12 years ago)
Author:
epitzer
Message:

Properly copy serializers when initializing global configuration. (#1136)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs

    r4068 r4175  
    4040  [StorableClass]
    4141  public sealed class StorableSerializer : ICompositeSerializer {
     42
     43    public StorableSerializer() {
     44      accessorListCache = new AccessorListCache();
     45      accessorCache = new AccessorCache();
     46      constructorCache = new Dictionary<Type, Constructor>();
     47      hookCache = new Dictionary<HookDesignator, List<StorableReflection.Hook>>();
     48    }
    4249
    4350    #region ICompositeSerializer implementation
     
    122129      try {
    123130        return GetConstructor(type)();
    124       }
    125       catch (TargetInvocationException x) {
     131      } catch (TargetInvocationException x) {
    126132        throw new PersistenceException(
    127133          "Could not instantiate storable object: Encountered exception during constructor call",
     
    174180    private sealed class AccessorListCache : Dictionary<Type, IEnumerable<DataMemberAccessor>> { }
    175181    private sealed class AccessorCache : Dictionary<MemberInfo, DataMemberAccessor> { }
     182    private delegate object Constructor();
    176183
    177184    #endregion
     
    179186    #region caches
    180187
    181     private AccessorListCache accessorListCache = new AccessorListCache();
    182     private AccessorCache accessorCache = new AccessorCache();
    183 
    184     private delegate object Constructor();
    185 
    186     private Dictionary<Type, Constructor> constructorCache =
    187       new Dictionary<Type, Constructor>();
    188 
    189     private Dictionary<HookDesignator, List<StorableReflection.Hook>> hookCache =
    190       new Dictionary<HookDesignator, List<StorableReflection.Hook>>();
     188    private AccessorListCache accessorListCache;
     189    private AccessorCache accessorCache;
     190    private Dictionary<Type, Constructor> constructorCache;
     191    private Dictionary<HookDesignator, List<StorableReflection.Hook>> hookCache;
    191192
    192193    #endregion
Note: See TracChangeset for help on using the changeset viewer.