为什么要使用GC.Sup pressFinalize()时,有没有终结?要使、GC、pressFinalize、Sup

2023-09-05 03:43:44 作者:提笔隽情书

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

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.