Compare commits
2 commits
20ffee6d43
...
eaaa7abc77
| Author | SHA1 | Date | |
|---|---|---|---|
|
eaaa7abc77 |
|||
|
799c4d622e |
1 changed files with 12 additions and 3 deletions
|
|
@ -8,7 +8,7 @@ namespace Geekeey.Process;
|
|||
/// <summary>
|
||||
/// Represents an asynchronous execution of a command.
|
||||
/// </summary>
|
||||
public sealed partial class CommandTask<TResult> : IDisposable
|
||||
public partial class CommandTask<TResult> : IDisposable
|
||||
{
|
||||
private readonly Process _process;
|
||||
|
||||
|
|
@ -19,6 +19,14 @@ public sealed partial class CommandTask<TResult> : IDisposable
|
|||
ProcessId = processId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finalizer to ensure resources are released.
|
||||
/// </summary>
|
||||
~CommandTask()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Underlying task.
|
||||
/// </summary>
|
||||
|
|
@ -79,10 +87,11 @@ public sealed partial class CommandTask<TResult> : IDisposable
|
|||
public void Dispose()
|
||||
{
|
||||
Task.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed partial class CommandTask<TResult>
|
||||
public partial class CommandTask<TResult>
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts the command task into a regular task.
|
||||
|
|
@ -91,4 +100,4 @@ public sealed partial class CommandTask<TResult>
|
|||
{
|
||||
return commandTask.Task;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue