"Zeng" <Ze******@hotmail.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...
Hi,
If a thread goes out of scope and the working proc (ThreadStart) is done
processing, does it eventually get finalized just like unreferenced
memory?
thanks!
Yes. Unless, of course, you have unmanaged resources (like a database
connection) in the thread. Then you may eventually wind up with a
noticeable leak. You can use a class to govern the thread. Make sure it
inherits : IDisposable and add a ~Destructor to handle all unmanaged
resources.
You may also want to run the worker thread with the IsBackground property
set to true so destruction happens immediately if the main app is
terminated.
J. Buelna - Houston, TX