handle-leak

How to avoid leaking handles when invoking in UI from System.Threading.Timer?

It seems like calling Invoke on a winforms control in a callback from a System.Threading.Timer leaks handles until the timer is disposed. Does anyone have an idea of how to work around this? I need to poll for a value every second and update the UI accordingly. I tried it in a test project to make sure that that was indeed the cause o...

Handle leaks with .NET System.Threading.Thread class

I've a problem that number of Handles in my app is continuously growing. I did the debugging and recognize that this is caused by System.Threading.Thread class which is used for some routine. To simplify the debugging I’ve created a sample .NET application: ... private void button1_Click(object sender, EventArgs e) { ...