C
Cartoper
I am developing on VS2005 SP1. I have a batch process that is running
in the background that is increasing the handle count of the app and
never decrements it. Here is the code that starts the thread:
ThreadStart threadDelegate = new ThreadStart(ProcessFileList);
this.webUpdateThread = new Thread(threadDelegate);
this.webUpdateThread.Start();
The call to start increases the handle count by 4 and it never goes
down. This all happens in a class called WebUpdate which is the
container for the thread. The class does contain one AutoResetEvent
that is closed in WebUpdate.Dispose() method and two (2) events
handlers. When the thread is finished one of the event handlers is
called to tell the main thread to clean up the WebUpdate class. After
the clean up, which is both calling WebUpdate.Dispose() and setting it
to null, GC.Collect() is called and the handle count is still 4 higher
then when it all began.
I have checked the handle count right before the end of the thread and
it is 5 higher then when everything started, after WebUpdate.Dispose()
is called it is back to 4 higher.
What am I missing?
Cartoper
in the background that is increasing the handle count of the app and
never decrements it. Here is the code that starts the thread:
ThreadStart threadDelegate = new ThreadStart(ProcessFileList);
this.webUpdateThread = new Thread(threadDelegate);
this.webUpdateThread.Start();
The call to start increases the handle count by 4 and it never goes
down. This all happens in a class called WebUpdate which is the
container for the thread. The class does contain one AutoResetEvent
that is closed in WebUpdate.Dispose() method and two (2) events
handlers. When the thread is finished one of the event handlers is
called to tell the main thread to clean up the WebUpdate class. After
the clean up, which is both calling WebUpdate.Dispose() and setting it
to null, GC.Collect() is called and the handle count is still 4 higher
then when it all began.
I have checked the handle count right before the end of the thread and
it is 5 higher then when everything started, after WebUpdate.Dispose()
is called it is back to 4 higher.
What am I missing?
Cartoper