Skip to content

Commit

Permalink
Use disposable pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Aug 6, 2024
1 parent 99ef2e1 commit 32bd91e
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ namespace Serval.Shared.Services;

public class ZipParatextProjectTextUpdater : ParatextProjectTextUpdaterBase, IDisposable

Check failure on line 3 in src/Serval/src/Serval.Shared/Services/ZipParatextProjectTextUpdater.cs

View workflow job for this annotation

GitHub Actions / Build

The type or namespace name 'ParatextProjectTextUpdaterBase' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 3 in src/Serval/src/Serval.Shared/Services/ZipParatextProjectTextUpdater.cs

View workflow job for this annotation

GitHub Actions / Build

The type or namespace name 'ParatextProjectTextUpdaterBase' could not be found (are you missing a using directive or an assembly reference?)
{
private bool _disposed;

public ZipParatextProjectTextUpdater(IZipContainer container)
: base(new ZipParatextProjectSettingsParser(container))
{
Expand All @@ -28,7 +30,19 @@ protected override Stream Open(string fileName)

public void Dispose()
{
_projectContainer.Dispose();
Dispose(true);
GC.SuppressFinalize(this);
}

protected virtual void Dispose(bool disposing)
{
if (!_disposed)
{
if (disposing)
{
_projectContainer.Dispose();
}
_disposed = true;
}
}
}

0 comments on commit 32bd91e

Please sign in to comment.