在处置之前,控件是否应该正确地从父对象中删除?

发布于 2024-11-28 04:59:17 字数 75 浏览 4 评论 0原文

那么,在将父对象设置为处置之前,我是否应该正确地从父对象中删除任何控件?如果在将其从父对象中删除之前将其释放,是否会导致父对象内存泄漏?

Well, should I properly remove any control from the parent object before it is set to dispose? Will this cause memory leak to the parent object if it is disposed before removing it from parent?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深者入戏 2024-12-05 04:59:17

处置就是释放非托管资源,而删除引用只会影响仅处理托管内存的垃圾收集器,因此不会,您不会以您所描述的方式导致内存泄漏。

Disposing is all about releasing unmanaged resources while removing a reference will only ever effect the garbage collector which only deals with managed memory so no, you will not cause a memory leak in the way you are describing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文