git-svn-id: trunk@36241 -
@@ -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;
@@ -2094,6 +2094,7 @@ begin
{$if defined(debugrefcount) or defined(VerbosePasTreeMem)}writeln('TPasElement.Destroy ',Name,':',ClassName);{$ENDIF}
raise Exception.Create('');
+ FParent:=nil;
inherited Destroy;