pisceswzh
Well-known member
- Joined
- Mar 19, 2007
- Messages
- 96
- Programming Experience
- 1-3
I use the BackgroundWorker to perform multi-thread process to increase user experience. However if users close the window before the BackgroundWorker finishes working and when it does finish and try to return values to the controls on the form, it will throw a exception: Object reference not set to an instance of an object. I understand because the window has already been closed.
I am just wondering if there is any good approach to avoid this exception since it is really meanless to continue return the result when the window has already been closed.
Thanks.
Tom
I am just wondering if there is any good approach to avoid this exception since it is really meanless to continue return the result when the window has already been closed.
Thanks.
Tom