From ca5addff8ef63ada9487719f7d95190e666f001c Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Mon, 25 May 2015 15:10:16 +0000 Subject: [PATCH] * fixed memory leaks introduced in r30908 git-svn-id: trunk@30911 - --- compiler/ncal.pas | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/compiler/ncal.pas b/compiler/ncal.pas index e696499b8a..c62bb4cc67 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -1480,6 +1480,8 @@ implementation funcretnode.free; if assigned(varargsparas) then varargsparas.free; + call_self_node.free; + call_vmt_node.free; {$ifndef symansistr} stringdispose(fforcedprocname); {$endif symansistr} @@ -2074,7 +2076,7 @@ implementation { inherited } else if (cnf_inherited in callnodeflags) then begin - selftree:=call_self_node; + selftree:=call_self_node.getcopy; { we can call an inherited class static/method from a regular method -> self node must change from instance pointer to vmt pointer) } @@ -2130,7 +2132,7 @@ implementation end; end else - selftree:=call_self_node + selftree:=call_self_node.getcopy else selftree:=methodpointer.getcopy; end; @@ -2167,7 +2169,7 @@ implementation else begin if methodpointer.nodetype=typen then - selftree:=call_self_node + selftree:=call_self_node.getcopy else selftree:=methodpointer.getcopy; end; @@ -2410,7 +2412,7 @@ implementation temp:=ctempcreatenode.create(objcsupertype,objcsupertype.size,tt_persistent,false); addstatement(statements,temp); { initialize objc_super record } - selftree:=call_self_node; + selftree:=call_self_node.getcopy; { we can call an inherited class static/method from a regular method -> self node must change from instance pointer to vmt pointer) @@ -2580,7 +2582,7 @@ implementation else { destructor called from exception block in constructor } if (cnf_create_failed in callnodeflags) then - vmttree:=ctypeconvnode.create_internal(call_vmt_node,voidpointertype) + vmttree:=ctypeconvnode.create_internal(call_vmt_node.getcopy,voidpointertype) else { inherited call, no create/destroy } if (cnf_inherited in callnodeflags) then