GDI objects count

S

sonali_reddy123

Hello all,

Can somebody help me out regarding how to maintain the GDI objects
count in my application it keeps on incrementing and once reaches to
10000 the application dies. Can somebody point to me some sample
application which could help me to understand how exactly manage the
object disposal I have been reading the articles for memory management
and GC but things are getting more and more confused to me.

Needed help urgently

Thanks in advance
 
B

Bob Powell [MVP]

Are these GDI objects or GDI+ objects? are you using brushes and so on and
forgetting to call Dispose() ?


--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
S

sonali_reddy123

No I am not using the GDI objects like pen or brush in my code its just
adding a huge data in the listviews.

I have two listviews which i am using to transfer the data the problem
is that when the
transfer time crosses some 2 or 3 hours the entire application crashes.

Later when I have seen the handle count I have found that it was around
10000 and then app crashes.

Now can I have any answer

I normally need some guidance about how objects should be disposed

Thanks in advance
 
B

Bob Powell [MVP]

This may be a bug in ListView. I've seen instances before where climbing GDI
handle counts were associated with ListView.

http://blog.kalmbachnet.de/?postid=36



--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

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