Compare commits

..

2 commits

Author SHA1 Message Date
eaaa7abc77
chore: disable code format rules in test projects
Some checks failed
default / dotnet-default-workflow (push) Failing after 1m41s
2026-05-09 22:57:40 +02:00
799c4d622e
chore: fix warning as error working
Some checks failed
default / dotnet-default-workflow (push) Failing after 1m6s
2026-05-09 22:50:43 +02:00

View file

@ -8,7 +8,7 @@ namespace Geekeey.Process;
/// <summary> /// <summary>
/// Represents an asynchronous execution of a command. /// Represents an asynchronous execution of a command.
/// </summary> /// </summary>
public sealed partial class CommandTask<TResult> : IDisposable public partial class CommandTask<TResult> : IDisposable
{ {
private readonly Process _process; private readonly Process _process;
@ -19,6 +19,14 @@ public sealed partial class CommandTask<TResult> : IDisposable
ProcessId = processId; ProcessId = processId;
} }
/// <summary>
/// Finalizer to ensure resources are released.
/// </summary>
~CommandTask()
{
Dispose();
}
/// <summary> /// <summary>
/// Underlying task. /// Underlying task.
/// </summary> /// </summary>
@ -79,10 +87,11 @@ public sealed partial class CommandTask<TResult> : IDisposable
public void Dispose() public void Dispose()
{ {
Task.Dispose(); Task.Dispose();
GC.SuppressFinalize(this);
} }
} }
public sealed partial class CommandTask<TResult> public partial class CommandTask<TResult>
{ {
/// <summary> /// <summary>
/// Converts the command task into a regular task. /// Converts the command task into a regular task.