mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 02:59:28 +02:00
* fixed refcounting problem. When copy an item over an existing one, the existing one was not dereferenced
* removed some old (useless) commented code git-svn-id: trunk@16424 -
This commit is contained in:
parent
d30952b408
commit
e770bc597f
@ -780,15 +780,10 @@ end;
|
||||
procedure TFPGObjectList.CopyItem(Src, Dest: Pointer);
|
||||
begin
|
||||
T(Dest^) := T(Src^);
|
||||
{if TObject(Dest^) is TInterfacedObject then
|
||||
T(Dest^)._AddRef;}
|
||||
end;
|
||||
|
||||
procedure TFPGObjectList.Deref(Item: Pointer);
|
||||
begin
|
||||
{if TObject(Item^) is TInterfacedObject then
|
||||
T(Item^)._Release
|
||||
else}
|
||||
if FFreeObjects then
|
||||
T(Item^).Free;
|
||||
end;
|
||||
@ -879,6 +874,8 @@ end;
|
||||
|
||||
procedure TFPGInterfacedObjectList.CopyItem(Src, Dest: Pointer);
|
||||
begin
|
||||
if Assigned(Pointer(Dest^)) then
|
||||
T(Dest^)._Release;
|
||||
T(Dest^) := T(Src^);
|
||||
if Assigned(Pointer(Dest^)) then
|
||||
T(Dest^)._AddRef;
|
||||
|
Loading…
Reference in New Issue
Block a user