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>
|
/// <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.
|
||||||
|
|
@ -91,4 +100,4 @@ public sealed partial class CommandTask<TResult>
|
||||||
{
|
{
|
||||||
return commandTask.Task;
|
return commandTask.Task;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue