Thread Terminate

From: Mark Payton (marktpayton_at_nospam.btinternet.com)
Date: 10/30/03


Date: Thu, 30 Oct 2003 19:35:37 -0000

Dear All,

I have a number of threads which contains a timer which performs a process
on the OnTimer event.

What happens is that when I close my application I get an AV.

I basically put this down to the fact that the process in my OnTimer event
within the Thread accesses some element on the form (which has been closed
down).

The Question is

Do I put something in the thread that checks if Application has been closed?
or
When I close the app, I set the Terminate property of the threads fired up
so they will terminate on their own?

if I pick the second option I then have to keep tabs on all the threads I
create.

What should I do?

Many thanks in advance.

Mark



Relevant Pages

  • Re: Form Timer issue in Access Game
    ... Howabout instead of using a timer after the second box is revealed, ... At some point, in a later OnTimer event, check the value ... The game is a matching game. ... the stopwatch timer on the form pauses for just a spilt second. ...
    (microsoft.public.access.forms)
  • Re: Form Timer issue in Access Game
    ... After the second text box is revealed I don't use the Timer Event at all. ... If I don't put in the DoEvents line, the second text box is never revealed. ... At some point, in a later OnTimer event, check the value ... The game is a matching game. ...
    (microsoft.public.access.forms)
  • Re: Thread Terminate
    ... In article, Mark Payton wrote: ... > I have a number of threads which contains a timer which performs a process ... A TTImer will not work in a secondary thread since it needs a message loop. ... form at design-time) its OnTimer event will execute in the main thread as ...
    (borland.public.delphi.nativeapi)
  • Re: Form Timer issue in Access Game
    ... I was suggesting that instead of your timer using the OnTimer event set ... if so clear both text boxes. ... You won't get an exact time like using your loop, ... > After the second text box is revealed I don't use the Timer Event at all. ...
    (microsoft.public.access.forms)
  • Re: Using a TTimer without a form
    ... you need to create a little class and put the Ontimer Event ... use the MyCurrentTimerID the Kill the timer using KillTImer; ... > procedure tmrDelay_onTimer(Sender: TObject); ... > and the OnTimer assignment is failing with an Incompatible types message. ...
    (alt.comp.lang.borland-delphi)