fcl-passrc: fixed releasing canonical set of anonymous enumtype

git-svn-id: trunk@36241 -
This commit is contained in:
Mattias Gaertner 2017-05-18 09:34:40 +00:00
parent c0fd038eaa
commit 0c66d8b362
2 changed files with 4 additions and 1 deletions

View File

@ -3497,8 +3497,10 @@ begin
EnumScope:=TPasEnumTypeScope(El.CustomData);
if EnumScope.CanonicalSet<>Parent then
begin
ReleaseAndNil(TPasElement(EnumScope.CanonicalSet));
if EnumScope.CanonicalSet<>nil then
EnumScope.CanonicalSet.Release;
EnumScope.CanonicalSet:=TPasSetType(Parent);
Parent.AddRef;
end;
end;
end;

View File

@ -2094,6 +2094,7 @@ begin
{$if defined(debugrefcount) or defined(VerbosePasTreeMem)}writeln('TPasElement.Destroy ',Name,':',ClassName);{$ENDIF}
raise Exception.Create('');
end;
FParent:=nil;
inherited Destroy;
end;