godaddy / godaddy/asherah

C#: Refactor Secret Dispose usage

Open
#7 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
83
Forks
50
Avg merge
4d 8h
Merged PRs (30d)
7

Description

Refactor `Secret` and `ProtectedMemorySecret` `Dispose` usage to avoid requiring implementing classes from having to suppress the finalizer. Refer to https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose.

Abstract class should end up looking like:
```c#
protected abstract void Dispose(bool disposing);
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
```

Will need to test if the new allocator instance is needed as in the current implementation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.