Window handles limit exceeded

G

Guest

Hi
Can anyone enlighten why dispose() a form does not seems to release
window handles. My .NET app crushes after while, typically when window
handles > 1400 or so. My main form creates/inits about 50 forms, tag to
tree nodes, so it appears when user clicks the node. In each form there
are the usual tabcontrols, groupboxes, editbox, etc. When the app fires up
handle count reach about 1000. Closing the form does not seem to reduce
the handle count ! Does each control utilizes a handle? Why dispose() does
not clean up the handle?

Help needed please.

regards
benc
 
N

Nicholas Paldino [.NET/C# MVP]

benc,

When you call Close on a form, it should call the Dispose method, which
should ultimately destroy the handle, and all child window handles.

If you want to be sure, try calling the DestroyHandle method on the Form
before you call Close/Dispose.

If you post your code as well, we could see if maybe there is an issue
with how you are closing the form (probably not, but just covering the
bases).

Hope this helps.
 

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