michael_hk
Centurion
Hi guys,
I have built a multi-threaded User Control that is used inside a WinForm. Sometimes when I close the form I got exception. The exception is caused by the thread inside the user control, it is still running even the winform is closed.
Exception: Object reference not set to an instance of an object.
Since I am not allowed to touch the winform, I am planning to put myThread.Abort() inside the Dispose method of my user control.
Is it the proper way to kill the thread?
Thanks in advance.
Michael
I have built a multi-threaded User Control that is used inside a WinForm. Sometimes when I close the form I got exception. The exception is caused by the thread inside the user control, it is still running even the winform is closed.
Exception: Object reference not set to an instance of an object.
Since I am not allowed to touch the winform, I am planning to put myThread.Abort() inside the Dispose method of my user control.
Is it the proper way to kill the thread?
Thanks in advance.
Michael
Last edited: