fpc/tests/webtbs/tw17560.pp
Jonas Maebe ae483061b1 + add cthreads for unix platforms
git-svn-id: trunk@16299 -
2010-11-03 12:41:32 +00:00

33 lines
504 B
ObjectPascal

{ %OPT=-gh }
// Creating a suspended TThread and then destroying it should not cause memory leaks.
// Also, Execute() method should not be called.
{$ifdef fpc}{$mode objfpc}{$endif}
uses
{$ifdef unix}
cthreads,
{$endif}
SysUtils, Classes;
type
TMyThread = class(TThread)
procedure Execute; override;
end;
var
t: TThread;
Flag: Boolean;
procedure TMyThread.Execute;
begin
flag := True;
end;
begin
Flag := False;
t := TMyThread.Create(True);
t.Free;
Halt(ord(Flag));
end.