mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-17 14:38:17 +02:00
* only call destructor in except block when there is a destructor
available
This commit is contained in:
parent
fcea95f596
commit
1a7f159fad
@ -427,8 +427,10 @@ implementation
|
|||||||
begin
|
begin
|
||||||
generate_except_block:=internalstatements(newstatement,true);
|
generate_except_block:=internalstatements(newstatement,true);
|
||||||
|
|
||||||
{ a constructor needs call destroy when it is not inherited }
|
{ a constructor needs call destructor (if available) when it
|
||||||
if (current_procdef.proctypeoption=potype_constructor) then
|
is not inherited }
|
||||||
|
if assigned(current_procdef._class) and
|
||||||
|
(current_procdef.proctypeoption=potype_constructor) then
|
||||||
begin
|
begin
|
||||||
pd:=current_procdef._class.searchdestructor;
|
pd:=current_procdef._class.searchdestructor;
|
||||||
if assigned(pd) then
|
if assigned(pd) then
|
||||||
@ -440,9 +442,7 @@ implementation
|
|||||||
cnilnode.create),
|
cnilnode.create),
|
||||||
ccallnode.create(nil,tprocsym(pd.procsym),pd.procsym.owner,load_self_node),
|
ccallnode.create(nil,tprocsym(pd.procsym),pd.procsym.owner,load_self_node),
|
||||||
nil));
|
nil));
|
||||||
end
|
end;
|
||||||
else
|
|
||||||
internalerror(200305107);
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1127,7 +1127,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.111 2003-05-13 19:14:41 peter
|
Revision 1.112 2003-05-13 21:26:38 peter
|
||||||
|
* only call destructor in except block when there is a destructor
|
||||||
|
available
|
||||||
|
|
||||||
|
Revision 1.111 2003/05/13 19:14:41 peter
|
||||||
* failn removed
|
* failn removed
|
||||||
* inherited result code check moven to pexpr
|
* inherited result code check moven to pexpr
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user