Explorar o código

* fix memory leaks in create_dwarf and types_dec procedures thanks to Giulio Bernardi's detailed report

git-svn-id: trunk@11236 -
Almindor %!s(int64=17) %!d(string=hai) anos
pai
achega
62205d0346
Modificáronse 2 ficheiros con 4 adicións e 3 borrados
  1. 2 2
      compiler/pdecl.pas
  2. 2 1
      compiler/pmodules.pas

+ 2 - 2
compiler/pdecl.pas

@@ -574,11 +574,11 @@ implementation
                { Generic is never a type renaming }
                hdef.typesym:=newtype;
              end;
+           if assigned(generictypelist) then
+             generictypelist.free;
          until token<>_ID;
          typecanbeforward:=false;
          symtablestack.top.SymList.ForEachCall(@resolve_type_forward,nil);
-         if assigned(generictypelist) then
-           generictypelist.free;
          block_type:=old_block_type;
       end;
 

+ 2 - 1
compiler/pmodules.pas

@@ -139,7 +139,8 @@ implementation
         if (tf_needs_dwarf_cfi in target_info.flags) and
            (af_supports_dwarf in target_asm.flags) then
           begin
-            current_asmdata.asmlists[al_dwarf]:=TAsmList.create;
+            current_asmdata.asmlists[al_dwarf].Free;
+            current_asmdata.asmlists[al_dwarf] := TAsmList.create;
             current_asmdata.asmcfi.generate_code(current_asmdata.asmlists[al_dwarf]);
           end;
       end;