I have a WPF application with threads. How do I abort all threads when closing the application?
After you create the thread, set the IsBackground
property to true
.
Thread th = new Thread(new ThreadStart(Start));
th.IsBackground = true;
th.Start();