Skip to content

Commit

Permalink
Update dispose access modifier (#614)
Browse files Browse the repository at this point in the history
* Changed from public to protected

* Updated implementations
  • Loading branch information
shaggygi authored and krwq committed Jul 22, 2019
1 parent 322de72 commit 030958a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/System.Device.Gpio/System/Device/Gpio/GpioDriver.cs
Expand Up @@ -113,7 +113,7 @@ public void Dispose()

protected virtual void Dispose(bool disposing)
{
// Nothing to do in the base class.
// Nothing to do in base class.
}
}
}
Expand Up @@ -241,13 +241,14 @@ public override unsafe void WriteRead(ReadOnlySpan<byte> writeBuffer, Span<byte>
}
}

public override void Dispose(bool disposing)
protected override void Dispose(bool disposing)
{
if (_deviceFileDescriptor >= 0)
{
Interop.close(_deviceFileDescriptor);
_deviceFileDescriptor = -1;
}

base.Dispose(disposing);
}
}
Expand Down
Expand Up @@ -115,7 +115,7 @@ public override void WriteRead(ReadOnlySpan<byte> writeBuffer, Span<byte> readBu
new Span<byte>(byteArray).CopyTo(readBuffer);
}

public override void Dispose(bool disposing)
protected override void Dispose(bool disposing)
{
_winI2cDevice?.Dispose();
_winI2cDevice = null;
Expand Down
2 changes: 1 addition & 1 deletion src/System.Device.Gpio/System/Device/I2c/I2cDevice.cs
Expand Up @@ -63,7 +63,7 @@ public void Dispose()
GC.SuppressFinalize(this);
}

public virtual void Dispose(bool disposing)
protected virtual void Dispose(bool disposing)
{
// Nothing to do in base class.
}
Expand Down
Expand Up @@ -223,13 +223,14 @@ private unsafe void Transfer(byte* writeBufferPtr, byte* readBufferPtr, int buff
}
}

public override void Dispose(bool disposing)
protected override void Dispose(bool disposing)
{
if (_deviceFileDescriptor >= 0)
{
Interop.close(_deviceFileDescriptor);
_deviceFileDescriptor = -1;
}

base.Dispose(disposing);
}
}
Expand Down
Expand Up @@ -118,7 +118,7 @@ public override void TransferFullDuplex(ReadOnlySpan<byte> writeBuffer, Span<byt
byteArray.CopyTo(readBuffer);
}

public override void Dispose(bool disposing)
protected override void Dispose(bool disposing)
{
_winDevice?.Dispose();
_winDevice = null;
Expand Down
4 changes: 2 additions & 2 deletions src/System.Device.Gpio/System/Device/Spi/SpiDevice.cs
Expand Up @@ -56,9 +56,9 @@ public void Dispose()
GC.SuppressFinalize(this);
}

public virtual void Dispose(bool disposing)
protected virtual void Dispose(bool disposing)
{
//Nothing to do in base class.
// Nothing to do in base class.
}
}
}

0 comments on commit 030958a

Please sign in to comment.