Explorar o código

Avoid memory leak for InstrWriter field in powerpc TAssembler descendants

git-svn-id: trunk@34402 -
pierre %!s(int64=9) %!d(string=hai) anos
pai
achega
c327a07414
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;