Avoid memory leak for InstrWriter field in powerpc TAssembler descendants

git-svn-id: trunk@34402 -
This commit is contained in:
pierre 2016-08-30 21:21:59 +00:00
parent 7eea450a52
commit c327a07414

View File

@ -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;