(.NET)CriticalFinalizerObject - 是什么真的? [英] (.net) CriticalFinalizerObject - What does it really do?

查看:211
本文介绍了(.NET)CriticalFinalizerObject - 是什么真的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对这个类的理解是,你应该使用它时,你要确保终结(析构函数)或类被调用,但是从几个测试我做到了,它似乎是不正确的。如果它不确保Dispose方法被调用时,有没有做任何其他方式?例如,如果我想确保一些code运行结束我的对象,即使我通过任务管理器或一些接近我的程序?

My understanding about this class is that you should use it when you want to be sure that the Finalizer(destructor) or the class is called, but from a couple of tests I did, it doesn't seem to be true. If it does not make sure that the dispose method is called, is there any other way of doing it? For example, if i want to make sure that some code is run to end my object, even if I close my program via Task Manager or something?

推荐答案

克里斯Brumme有在某种程度上,我不知道也永远不会突破解释了这个话题。 :)

这篇关于(.NET)CriticalFinalizerObject - 是什么真的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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