+ Test for Mantis #17560

git-svn-id: trunk@16291 -
This commit is contained in:
sergei 2010-11-01 22:38:15 +00:00
parent ffc357a528
commit d8eccf008d
2 changed files with 29 additions and 0 deletions

1
.gitattributes vendored
View File

@ -10720,6 +10720,7 @@ tests/webtbs/tw17546.pp svneol=native#text/plain
tests/webtbs/tw1754c.pp svneol=native#text/plain
tests/webtbs/tw1755.pp svneol=native#text/plain
tests/webtbs/tw17550.pp svneol=native#text/plain
tests/webtbs/tw17560.pp svneol=native#text/plain
tests/webtbs/tw1758.pp svneol=native#text/plain
tests/webtbs/tw17604.pp svneol=native#text/plain
tests/webtbs/tw17646.pp svneol=native#text/plain

28
tests/webtbs/tw17560.pp Normal file
View File

@ -0,0 +1,28 @@
{ %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 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.