Habe mal mit Berlin einen kleinen Test geschrieben:
Delphi-Quellcode:
procedure ttestexception.Test1;
var p : Pointer;
begin
try
Writeln('Test 1');
raise etestexception.Create;
except
Writeln('Exceptblock 1');
Writeln('AcquireExceptionObject');
p := AcquireExceptionObject;
ReleaseExceptionObject;
end;
Writeln('Leave Test1');
end;
procedure ttestexception.Test2;
var p : Pointer;
begin
try
writeln;
Writeln('Test 2');
raise etestexception.Create;
except
Writeln('Exceptblock 2');
end;
Writeln('Leave Test2');
end;
{ EtestException }
constructor EtestException.create;
begin
inherited create('Test');
writeln('Create EtestException ');
end;
destructor EtestException.Destroy;
begin
writeln('Free EtestException ');
inherited;
end;
Result:
Code:
Test 1
Create EtestException
Exceptblock 1
AcquireExceptionObject
Leave Test1
Test 2
Create EtestException
Exceptblock 2
Free EtestException
Leave Test2
Done
Wird also nicht freigegeben