本文介绍了有没有可能的方法来启动“毁灭"? C#中的对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们都喜欢C#的垃圾收集器.我知道,它非常适合99.999%的应用程序...
但是我在想,是否有可能像在C ++中那样以任何方式手动销毁C#中的对象.我的意思是,它的内存将被释放,(当然,只要没有引用它),就好像GC已收集到该对象一样.
解决方案
We all love the C#''s garbage collector. I know, It''s perfectly great for 99.999% of application etc...
I was wondering however if it would be possible in any way to manually destroy an object in C#, as I can in C++. What I mean is that it''s memory will be freed, (of course providing there are no references to it), as if the GC has collected that object.
Is that achievable in C#, or is there an interesting "hack" that can enable such activity?
解决方案
这篇关于有没有可能的方法来启动“毁灭"? C#中的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!