在 .NET Core 中如果一个对象通过成员变量引用了自己(代码如下),这个对象是否会被 GC 正常回收?
public class EnterpriseUserService : IEnterpriseUserService
{
private readonly IEnterpriseUserService _enterpriseUserService;
public EnterpriseUserService()
{
_enterpriseUserService = this;
}
}来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1729/viewspace-3120352/ ,如需转载,请注明出处,否则将追究法律责任。