Z
Zytan
Threads are not auto-terminated when the main form closes (not that
they should be). What's the best way to terminate them when the
program exits? Catch the on close message of the form, and give a
signal to the threads that they must shut down? Seems I need a
destructor for that. Forms don't have an overridable Dispose method.
So, how can I react when the form closes?
Note my example thread just (abnormally) runs forever until it is told
to shut down via boolean data member. So, the form's close method
could just set this. (I know there's the Abort() method, but that
seems ugly, especially since it's not guaranteed to work.)
Zytan
they should be). What's the best way to terminate them when the
program exits? Catch the on close message of the form, and give a
signal to the threads that they must shut down? Seems I need a
destructor for that. Forms don't have an overridable Dispose method.
So, how can I react when the form closes?
Note my example thread just (abnormally) runs forever until it is told
to shut down via boolean data member. So, the form's close method
could just set this. (I know there's the Abort() method, but that
seems ugly, especially since it's not guaranteed to work.)
Zytan