为什么要使用GC.Sup pressFinalize()时,有没有终结? [英] Why use GC.SuppressFinalize() when there is no Finalizer?

查看:143
本文介绍了为什么要使用GC.Sup pressFinalize()时,有没有终结?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着问题的国家,我只是想知道,因为我一直在问,我没有线索,没有任何理由不对?

As the question states, I just wanted to know, because I've been asked and I don't have a clue, is there any reason for this whatsoever?

推荐答案

当一个类没有定义一个终结(析构函数),调用燮pressFinalize()上的类的实例没有影响。

When a class does not define a Finalizer (destructor), a call to SuppressFinalize() on an instance of that class has no effect.

当你看到它,它通常是一次性全面实施的遗留。只是将其删除或忽略它。

When you see it, it usually is a left-over of the full Disposable implementation. Just remove it or ignore it.

这篇关于为什么要使用GC.Sup pressFinalize()时,有没有终结?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆