/// <summary> /// Releases all managed resources. /// </summary> /// <param name="disposing">If <c>true</c>, all managed resources including the SPI connection will be released/closed.</param> protected virtual void Dispose(bool disposing) { if (disposing) { transferBuffer.Dispose(); connection.Dispose(); } }
protected override void Cleanup() { if (!ReferenceEquals(buffer, null)) { buffer.Dispose(); buffer = null; } }
// Protected implementation of Dispose pattern. protected void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { spiConnection.Dispose(); inputPollBuffer.Dispose(); } disposed = true; }