如何调试GDI对象泄漏? [英] How to debug GDI Object Leaks?

查看:116
本文介绍了如何调试GDI对象泄漏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太清楚如何去这样做。这是一个大的应用程序,我们正在对我们的大多数形式的GDI对象泄漏。

I'm not quite sure how to go about doing this. It is a large app, and we are having GDI object "leaks" on most of our forms.

是否有工具来帮帮忙?是否有关于如何使用这一工具的教程?

Is there a tool to help out? Is there a tutorial on how to use such a tool?

我是不是应该开始删除code从我们的形式,直到我缩小了罪犯了吗? (这里的code ALOT)。

Should I just start deleting code from our forms until I narrow the offender down? (there is ALOT of code).

推荐答案

原来,我只是用任务管理器,并试图重现问题。我们与我们的应用程序(和GDI对象泄漏)的问题是,我们使用一个静态的对象,并绑定到它。有/是.NET 3.5(ATLEAST)了一个错误的形式结束时,将不知道如何正确地处理所有的事,某些图形对象将保留在内存中。

Turns out that I just used Task Manager and tried reproducing the problem. Our issue with our app (and the GDI object leak) was that we were using a static object and binding to it. There was/is a bug with .net 3.5 (atleast) where the form when closing will not know how to dispose of everything correctly and certain graphic object will remain in memory.

这篇关于如何调试GDI对象泄漏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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