Skip to content

Commit

Permalink
IDisposable pattern is not needed anymore on the class
Browse files Browse the repository at this point in the history
  • Loading branch information
Kees committed Oct 17, 2023
1 parent 604976a commit ad495ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion ChromiumHtmlToPdfLib/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2620,7 +2620,6 @@ private async Task InternalDisposeAsync()
if (_disposed)
return;

_documentHelper?.Dispose();
_chromiumWaitEvent?.Dispose();

if (_browser != null)
Expand Down
15 changes: 7 additions & 8 deletions ChromiumHtmlToPdfLib/Helpers/DocumentHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace ChromiumHtmlToPdfLib.Helpers;
/// <summary>
/// This class contains helper methods
/// </summary>
internal class DocumentHelper : IDisposable
internal class DocumentHelper
{
#region Fields
/// <summary>
Expand Down Expand Up @@ -205,6 +205,12 @@ public DocumentHelper(
_imageLoadTimeout = imageLoadTimeout.Value;
WriteToLog($"Setting image load timeout to '{_imageLoadTimeout}' milliseconds");
}

~DocumentHelper()
{
// Just in case
_stopwatch?.Stop();
}
#endregion

#region ParseValue
Expand Down Expand Up @@ -992,11 +998,4 @@ internal void WriteToLog(string message)
}
}
#endregion

#region Dispose
public void Dispose()
{
_stopwatch?.Stop();
}
#endregion
}

0 comments on commit ad495ef

Please sign in to comment.