ICON导致内存泄漏 [英] Memory Leakage Due to ICON

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

问题描述

我有一个ImageList(_imageList)。在_imageList中我放了大量的图标。

现在我需要的是获取我放在_imageList中的所有图标的句柄,以便我可以销毁它们(DestoryIcon)并释放内存,因为它会导致内存泄漏。

I have an ImageList (_imageList). In _imageList I have put large numbers of Icons.
Now what I need is to get Handle of all Icons that I put in _imageList, so that I can destroy (DestoryIcon) them all and release the memory because it''s causing Memory leakage.

推荐答案

我的子应用程序中有数千个Icon(A)。所有这些图标都在ImageList(_imageList)中。在应用程序A结束时,我已经销毁了_imageList。但是,由数百个图标占据的内存仍然存在导致内存泄漏。那么,解决方案是什么。

I have thousands of Icon in my child application (A). All these icons are in ImageList (_imageList). At the end of application ''A'', I have Destroyed _imageList. But, the momory being occupied by hundreds of Icons are still there causing memory leakage. So, whats the solution.

展开 | 选择 | Wrap | 行号


ImageList.Images为您提供所有图像...
ImageList.Images gives you all the images ...


我知道但是那就是Image。图像无法转换为图标.....如果我们使用

((位图)图像).Hicon())来获取Handle to Icon并将其销毁。它没有任何意义,因为它创造和摧毁了Icon。
I know but thats the Image. Image is not convertable to Icon.....If we use
((Bitmap)image).Hicon()) to get Handle to Icon and destroy it. It''s no meaning because it create and destory that Icon.


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

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