Browse Source

* Use an own put for tfpginterfacedobjectlist as per bug #39846.
Maybe not the most elegant, but solves the immediately

(cherry picked from commit f532cf16983992b278e7fb0254312f935022151b)

marcoonthegit 3 years ago
parent
commit
0f6deab1d9
1 changed files with 2 additions and 1 deletions
  1. 2 1
      rtl/objpas/fgl.pp

+ 2 - 1
rtl/objpas/fgl.pp

@@ -1214,7 +1214,8 @@ end;
 
 
 procedure TFPGInterfacedObjectList.Put(Index: Integer; const Item: T);
 procedure TFPGInterfacedObjectList.Put(Index: Integer; const Item: T);
 begin
 begin
-  inherited Put(Index, @Item);
+  CheckIndex(Index);
+  InternalItems[Index] := @Item; // eventually calls copyitem()
 end;
 end;
 
 
 function TFPGInterfacedObjectList.Add(const Item: T): Integer;
 function TFPGInterfacedObjectList.Add(const Item: T): Integer;