c# - c# 中的 Process 类是非托管资源吗?
问题描述
this.proc - 是Process[]
.
我应该在“释放你自己的状态(非托管对象)”块中写任何东西来释放Process[]
吗?
protected virtual void Dispose(bool disposing)
{
if (!_disposed)
{
if (disposing)
{
foreach (var i in this.proc)
{
i?.Dispose();
}
}
// Free your own state (unmanaged objects).
// Set large fields to null.
_disposed = true;
}
}
解决方案
推荐阅读
- python - 使用 Numpy 在哪里定义多个条件?
- r - 如何使用 rgamma 对 r 中的 gamma 进行采样?
- javascript - 显示附加如果变量等于这个或这个
- reactjs - React js 不会在生产中加载 css
- python - Regex/Difflib/Datastructure算法问题
- java - 将数组存储到对象
- mysql - 使用 LIKE 条件从 MySQL 中选择
- java - 如何在构造函数java中制作ax个参数
- python - 切换 Homebrew 安装的 Python 版本
- javascript - 匹配数组的返回索引不起作用 - Javascript Google Apps 脚本