I a WPF/C# application that has a psuedo-process of Click a button > Start a thread to take a picture from a web cam API > Instantiate the web cam API > API starts a callback thread > Picture is taken > API object is disposed
These steps generally work except for the last portion where the callback thread to the web cam API does not close out. So, in my Task Manager, I invariably end up with a "ghost" process, which shares the same name as my base WPF application. Also, making a second call to the same web cam API (to take a second picture) fails miserably.
So, I'm trying to find a way to make sure that all of my threads from my root application are forcibly closed out at all times. Is there a way to ensure that no threads are left over?
If you set IsBackground
to true on those threads they will be terminated at shutdown.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With