* crash with constructor/destructor combi

This commit is contained in:
peter 2003-05-06 17:59:36 +00:00
parent 47ba6c2c4e
commit cd0cbd4436

47
tests/tbs/tb0453.pp Normal file
View File

@ -0,0 +1,47 @@
{$MODE objfpc}
uses SysUtils, Classes;
type
TFirstClass = class
constructor Create;
destructor Destroy; override;
end;
TSecondClass = class(TFirstClass)
constructor Create;
destructor Destroy; override;
end;
constructor TFirstClass.Create;
begin
raise Exception.Create('');
end;
destructor TFirstClass.Destroy;
begin
WriteLn('TFirstClass.Destroy');
inherited Destroy;
end;
constructor TSecondClass.Create;
begin
inherited Create;
end;
destructor TSecondClass.Destroy;
begin
WriteLn('TSecondClass.Destroy');
end;
var
o: TSecondClass;
begin
try
try
o := TSecondClass.Create;
finally
o.Free;
end;
except
on e: Exception do
WriteLn('Exception: ', e.Message);
end;
end.