Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Feb : Thread destructor
| Subject: | Thread destructor |
| Posted by: | "Karsten" (..@mail.com) |
| Date: | Tue, 15 Feb 2005 13:57:02 |
Hi
I just want to verify if it is to free the object after calling inherited in
the destructor?
If not would this destructor work?
destructor tt.destroy;
begin
myobj.GoOn := False;
Waitfor;
myobj.Free;
inherited;
end;
---------------------------
type
tt=class(tthread)
protected
procedure execute;override;
public
myobj: TMyObject; //Created in constructor
destructor destroy; override;
end;
destructor tt.destroy;
begin
myobj.GoOn := False;
inherited;
myobj.Free;
end;
procedure tt.execute;
begin
while myobj.GoOn do ...;
end;