我只是在想一个问题,如果有这样的课程:
public class A
{
public CustomType PropertyA { get; set; }
public CustomType PropertyB { get; set; }
}
我创建了它的一个实例:
var a = new A
{
PropertyA = SomeValue,
PropertyB = SomeOtherValue
};
然后我设置PropertyA为 null 就像a.PropertyA = null;将PropertyA的值作为垃圾收集一样,还是在对象被收集之前不会被a收集?
绝地无双
相关分类