فهرست منبع

Avoid memory leak for InstrWriter field in powerpc TAssembler descendants

git-svn-id: trunk@34402 -
pierre 9 سال پیش
والد
کامیت
c327a07414
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  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;