gpt4 book ai didi

c# - IDisposable.Dispose() 是否自动调用?

转载 作者:IT王子 更新时间:2023-10-29 03:48:28 36 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Will the Garbage Collector call IDisposable.Dispose for me?

我有一个包含一些非托管资源的类。我的类实现了IDisposable接口(interface),在Dispose()方法中释放了非托管资源。我必须调用 Dispose() 方法还是会以某种方式自动调用它?垃圾收集器会调用它吗?

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com