浏览代码

+ Fixed bug #3461

michael 21 年之前
父节点
当前提交
77c5aeb350
共有 1 个文件被更改,包括 13 次插入2 次删除
  1. 13 2
      fcl/inc/contnrs.pp

+ 13 - 2
fcl/inc/contnrs.pp

@@ -165,7 +165,15 @@ end;
 
 
 Procedure TObjectList.SetItem(Index: Integer; AObject: TObject);
 Procedure TObjectList.SetItem(Index: Integer; AObject: TObject);
 
 
+Var
+  O : TObject;
+
 begin
 begin
+  if OwnsObjects then
+    begin
+    O:=GetItem(Index);
+    FreeAndNil(O);
+    end;
   Put(Index,Pointer(AObject));
   Put(Index,Pointer(AObject));
 end;
 end;
 
 
@@ -497,7 +505,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.6  2002-09-07 15:15:24  peter
+  Revision 1.7  2004-12-22 12:05:41  michael
+  + Fixed bug 3461
+
+  Revision 1.6  2002/09/07 15:15:24  peter
     * old logs removed and tabs fixed
     * old logs removed and tabs fixed
 
 
   Revision 1.5  2002/08/09 09:48:28  michael
   Revision 1.5  2002/08/09 09:48:28  michael
@@ -515,4 +526,4 @@ end.
   Revision 1.1  2002/07/16 13:34:39  florian
   Revision 1.1  2002/07/16 13:34:39  florian
     + skeleton for contnr.pp added
     + skeleton for contnr.pp added
 
 
-}
+}