namespace HeuristicLab.Problems.ProgramSynthesis.Push.Interpreter { using HeuristicLab.Core; using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration; public class PooledPushInterpreter : PushInterpreter { private readonly PushInterpreterPool pool; public PooledPushInterpreter(PushInterpreterPool pool, IReadOnlyPushConfiguration config, InterpreterPoolContainer poolContainer, IRandom random = null) : base(config, random, poolContainer) { this.pool = pool; } public override void Dispose() { base.Dispose(); ClearStacks(); pool.Free(this); } } }