I have a simple program that has backgroundworkers, and it runs with no stop, and no matter when I close it, it will always have some still running (or all of them) and I’ve noticed that closing the application doesn’t completly kill it. After running it some times, there are processes (1 for each run) that remain on the process tab of the windows task manager.
Why do they remain? what do I do for them not to ?
ps.: I’ve read questions about backgroundworker’s behavour in application closing, but I guess it’s not acting as intended then. Any suggestions ?
A better approach is to stop / kill the thread using an event or custom action before applicaion in closed.
like as follows
This post at the forum will give you more insight.
Also, have a look at MSDN for details about how to manage Backgroundworker Threads
Hope it helps