Browse Source

Avoid memory leak for InstrWriter field in powerpc TAssembler descendants

git-svn-id: trunk@34402 -
pierre 9 years ago
parent
commit
c327a07414
1 changed files with 4 additions and 0 deletions
  1. 4 0
      compiler/ppcgen/agppcgas.pas

+ 4 - 0
compiler/ppcgen/agppcgas.pas

@@ -401,6 +401,8 @@ unit agppcgas;
     constructor TPPCGNUAssembler.create(info: pasminfo; smart: boolean);
       begin
         inherited;
+        if assigned(InstrWriter) then
+          InstrWriter.free;
         InstrWriter := TPPCInstrWriter.create(self);
       end;
 
@@ -441,6 +443,8 @@ unit agppcgas;
     constructor TPPCAppleGNUAssembler.create(info: pasminfo; smart: boolean);
       begin
         inherited;
+        if assigned(InstrWriter) then
+          InstrWriter.free;
         InstrWriter := TPPCInstrWriter.create(self);
       end;