GDI Object Leak

G

Guest

We are experiencing heavy GDI object leakage in our application. I narrowed it down to the image lists created by Dev Studio are not being released. Here is the line that seems to leak and how I am testing it:

Line added by DevStudio that is found in InitializeComponent() of a form:
this.DateTimeimageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("DateTimeimageList.ImageStream")));

If I comment out this line (prevents it from loading the images from the resource file), our GDI object count goes from a leak of 412 to 124??? This is how I know:

1. I create the form (I don't even show it).
2. Dispose the form, and set the object to null.
3. GC.Collect(GC.MaxGeneration);


I know this is not our only problem, but I don't understand how this is causing a problem at all. Any ideas on why? Any suggestions on what tools we can use to find the other GDI object leaks? Below is our development environment:

Dev Studio 2002
Framework 1.0 (with latest service pack)
Development in C#
Standard Windows Application


Thanks in advance for the time towards this question.

- Buck
 
G

Guest

There are several GDI leaks (numeric up/down, DateTime picker, and any form with an ImageList) that are fixed by a Microsoft QFE. To get the QFE, you must contact Microsoft. Some of these leaks are fixed in .Net 2003

kb article number: 813967
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top