Rob Kennedy wrote:
> That code doesn't do anything useful at all.

It is just a sample, reduced to the bare minimum to
demonstrate the problem.

> It creates a paused thread,
> sets a property, and destroys the thread.

> Destroying the thread forces
> the thread to resume, at which point the thread will call the abstract
> Execute method and crash. 

It also crashes in a derived class with a overridden Execute methode.
Instead the problem is in TThread.WaitFor, line 
CheckThreadError(GetExitCodeThread(H[0], Result)) in case of 
FreeOnTerminate is set to true, I need to override Destroy and set
it to False before the call to inherited Destroy in order to avoid 
the exception. I guess it is a bug even though the sample is
of course nonsense code.

Arno Garrels


 



_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to