FIX: ImageList Class Leaks GDI Objects ImageList会造成GDI对象泄露

搞了快一个礼拜都不解的问题,今天找到原因了。。。我都无奈了。。微软自己的问题。

原文地址:http://support.microsoft.com/kb/813967


大概翻译下:


SYMPTOMS:

When you use an ImageList class in a Microsoft Windows Forms application, the calling process will leak some GDI objects for each new instance of the ImageList class. When the number of GDI objects runs out, any later operation that requires an allocation of a new GDI object fails.

The type of failure depends on the type of operation that is requested. Typically, an OutOfMemoryException error occurs. You can view the number of GDI objects that a process uses in Windows Task Manager. To do this, click Select columns on the View menu, and then click to select the check box for GDI Objects to add the GDI objects count to the default view


大概翻译下:

症状:

当你使用ImageList类在微软的窗体中的时候,在每个包含Imagelist创建新实例中的进程将会泄露GDI对象。当GDI对象被用完,将会出现请求分配GDI对象失败


这种失败取决于操作的类型。一般会出现有OutOfMemoryException出现。您可以在 Windows 任务管理器查看一个进程使用的 GDI 对象数。要执行此操作在 视图 菜单上单击 选择列,然后单击以选中要添加到默认视图的 GDI 对象计数的 GDI 对象 对应的复选框。

后面竟然有这么一句:

Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next .NET Framework service pack that contains this fix.

因此,如果你不是被这个问题影响的很严重的话,微软推荐你耐心的等等下个版本,这个问题将会被修复。。。


我每次使用一个CImageList就会造成4个GDI的泄露,如果不玩命用的话,还是能勉强凑活的。。。






评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值