* Fixed memory leak of tlabelnode.labsym.

git-svn-id: trunk@35538 -
This commit is contained in:
yury 2017-03-07 10:14:59 +00:00
parent 60e21e4222
commit 54f1890fea

View File

@ -2033,10 +2033,18 @@ implementation
destructor tlabelnode.destroy;
begin
{ Remove reference in labelsym, this is to prevent
goto's to this label }
if assigned(labsym) and (labsym.code=pointer(self)) then
labsym.code:=nil;
if assigned(labsym) then
begin
if not assigned(labsym.Owner) then
labsym.Free // Free labelsym if it has no owner
else
if labsym.code=pointer(self) then
begin
{ Remove reference in labelsym, this is to prevent
goto's to this label }
labsym.code:=nil;
end;
end;
inherited destroy;
end;