소스 검색

* Fix bug with nameIndex

Michaël Van Canneyt 1 년 전
부모
커밋
93937f99ae
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      packages/rtl-objpas/src/inc/rtti.pp

+ 4 - 3
packages/rtl-objpas/src/inc/rtti.pp

@@ -5913,24 +5913,25 @@ begin
       else
         begin
         NameIndexes[IdxCount]:=TP^.NameIndex;
-        Inc(IdxCount);
         obj := GRttiPool[FUsePublishedOnly].GetByHandle(TP);
         if Assigned(obj) then
           begin
           Prop:=obj as TRttiProperty;
-          FProperties[I]:=Prop;
+          FProperties[IdxCount]:=Prop;
           end
         else
           begin
           Prop:=TRttiProperty.Create(Self, TP);
-          FProperties[I]:=Prop;
+          FProperties[IdxCount]:=Prop;
           GRttiPool[FUsePublishedOnly].AddObject(Prop);
           end;
+        Inc(IdxCount);
         end;
       Prop.FVisibility:=MemberVisibilities[Info^.Visibility];
       Prop.FStrictVisibility:=Info^.StrictVisibility;
       end;
     FPropertiesResolved:=True;
+    SetLength(FProperties,IdxCount);
   finally
     if Assigned(List) then
       FreeMem(List);