浏览代码

* fixed memory leaks

git-svn-id: branches/jvmbackend@18598 -
Jonas Maebe 14 年之前
父节点
当前提交
f3f378496f
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      compiler/jvm/njvmutil.pas

+ 6 - 2
compiler/jvm/njvmutil.pas

@@ -86,14 +86,18 @@ implementation
               ccallparanode.create(p,nil)));
               ccallparanode.create(p,nil)));
         end
         end
       else
       else
-        { records/arrays/... are automatically initialised }
-        result:=cnothingnode.create;
+        begin
+          p.free;
+          { records/arrays/... are automatically initialised }
+          result:=cnothingnode.create;
+        end;
     end;
     end;
 
 
 
 
   class function tjvmnodeutils.finalize_data_node(p:tnode):tnode;
   class function tjvmnodeutils.finalize_data_node(p:tnode):tnode;
     begin
     begin
       // do nothing
       // do nothing
+      p.free;
       result:=cnothingnode.create;
       result:=cnothingnode.create;
     end;
     end;