My application appears to have a recourse leak. When the user starts
a background process, the handle count in Process Explorer (PE) goes
up by about 10, sometime 1 or 2 more, sometimes 1 or 2 less. When the
task is completed, there are somewhere between 4 and 7 handles still
open.
My process is loading images and shrinking them down. I went through
all the code and found some objects that implement the IDisposable
interface which I was not calling Dispose or Close on. Objects such
as AutoResetEvent, Graphic, and Image. I have either encapsulated
them in a using clause or called Dispose on the object before setting
to null and it seems to have no effect.
So I am now wondering where might I find this leak? In the unmanaged
thread handles need to be closed when no longer needed. I am not
seeing any way of cleaning up a managed thread, once it is completed.
Is there some cleanup procedure I am missing or are there other
objects out there that I am not cleaning up correctly?
Are there any good tools out there that might help me in finding this
resource leak?
Cartoper