在处置之前,控件是否应该正确地从父对象中删除?
那么,在将父对象设置为处置之前,我是否应该正确地从父对象中删除任何控件?如果在将其从父对象中删除之前将其释放,是否会导致父对象内存泄漏?
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
处置就是释放非托管资源,而删除引用只会影响仅处理托管内存的垃圾收集器,因此不会,您不会以您所描述的方式导致内存泄漏。
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.