protected override void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { _output.Dispose(); } _disposed = true; base.Dispose(disposing); }
public Cursor(IChannelProvider provider, RowToRowScorerBase parent, DataViewRowCursor input, bool[] active, IEnumerable <DataViewSchema.Column> activeMapperColumns) : base(provider, input) { Ch.AssertValue(parent); Ch.AssertValue(active); Ch.AssertValue(activeMapperColumns); _bindings = parent.GetBindings(); Schema = parent.OutputSchema; Ch.Assert(active.Length == _bindings.ColumnCount); _active = active; _output = _bindings.RowMapper.GetRow(input, activeMapperColumns); try { Ch.Assert(_output.Schema == _bindings.RowMapper.OutputSchema); _getters = parent.GetGetters(_output, iinfo => active[_bindings.MapIinfoToCol(iinfo)]); } catch (Exception) { _output.Dispose(); throw; } }