Windows.forms .net 2.0的内存泄漏 [英] Memory leaks with windows.forms .net 2.0

查看:111
本文介绍了Windows.forms .net 2.0的内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为我用c#而不是c ++编码,所以我有内存泄漏;).我试图对其进行分析,但是现在我陷入了困境.内存分析器有3种泄漏:

1:
-> DropTarget内存泄漏
我在Google上找到了解决方案.每个具有AllowDrop属性设置为"true"的控件.会出问题.我添加了代码以将它们设置为"false". ->问题解决了.

2:
-> OleCallback泄漏
由于OleCallback,richtextbox保持活动状态.我使用的丰富文本框是从标准的文本框派生的.但是我看不到应该影响它的代码.有什么主意吗?

3:
-> UserPreferenceChangedEventHandler
由于上面的引用,标准DataGridView保持活动状态.我从来没有在我的代码及其标准控件中连接此信号.

我仅在调试模式下使用了内存探查器.是的,我还具有编辑并继续"功能.内存泄漏 :).

请帮助;)

Since i code c# instead of c++ i have memory leaks ;). I tried to analyse it, but now i am stucked. The memory profiler had 3 kind of leaks:

1:
-> DropTarget memory leak
I have found a solution on google. Each control that has the AllowDrop property set to "true" makes problems. I added code to set them to "false" -> problem solved. Is this the way it should be?

2:
-> OleCallback leak
The richtextbox stays alive because of the OleCallback. The richtextbox i use is derived from the standard one. But i can't see code that should affect it. Any idea?

3:
-> UserPreferenceChangedEventHandler
The standard DataGridView stays alive because of the above reference. I never connect this signal in my code, and its the standard control.

I used memory profiler only in Debug mode.... and yes i also had the "edit and continue" memory leak :).

Please help ;)

推荐答案

您是否检查过.NET 2.0 SP 1是否修复了其中任何一个? >
我怀疑您自己不能解决后两个问题,因为它们是控件内部的问题.我不知道有什么解决方法.
Have you checked to see if any of these are fixed by .NET 2.0 SP 1 ?

I suspect you can't fix the last two yourself, as they are problems inside the controls. I don't know of any work arounds.


这篇关于Windows.forms .net 2.0的内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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