|
@@ -1059,7 +1059,7 @@ begin
|
|
|
exit;
|
|
exit;
|
|
|
Lp := Lst.FList;
|
|
Lp := Lst.FList;
|
|
|
for I := 0 to Lst.Count-1 do
|
|
for I := 0 to Lst.Count-1 do
|
|
|
- TObject(Lp[I]).Free;
|
|
|
|
|
|
|
+ TObject(Lp[I]).Free; // no nil needed
|
|
|
Lst.Free;
|
|
Lst.Free;
|
|
|
Lst := nil;
|
|
Lst := nil;
|
|
|
end;
|
|
end;
|
|
@@ -1112,7 +1112,7 @@ var
|
|
|
begin
|
|
begin
|
|
|
if FFreeObjects then
|
|
if FFreeObjects then
|
|
|
for i := 0 to FList.Count - 1 do
|
|
for i := 0 to FList.Count - 1 do
|
|
|
- TObject(FList[i]).Free;
|
|
|
|
|
|
|
+ TObject(FList[i]).Free; // no nil needed
|
|
|
FList.Clear;
|
|
FList.Clear;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
@@ -1152,7 +1152,7 @@ end;
|
|
|
procedure TFPObjectList.SetItem(Index: Integer; AObject: TObject);
|
|
procedure TFPObjectList.SetItem(Index: Integer; AObject: TObject);
|
|
|
begin
|
|
begin
|
|
|
if OwnsObjects then
|
|
if OwnsObjects then
|
|
|
- TObject(FList[Index]).Free;
|
|
|
|
|
|
|
+ TObject(FList[Index]).Free; // no nil needed
|
|
|
FList[index] := AObject;
|
|
FList[index] := AObject;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
@@ -1174,7 +1174,7 @@ end;
|
|
|
procedure TFPObjectList.Delete(Index: Integer);
|
|
procedure TFPObjectList.Delete(Index: Integer);
|
|
|
begin
|
|
begin
|
|
|
if OwnsObjects then
|
|
if OwnsObjects then
|
|
|
- TObject(FList[Index]).Free;
|
|
|
|
|
|
|
+ TObject(FList[Index]).Free; // no nil needed
|
|
|
FList.Delete(Index);
|
|
FList.Delete(Index);
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
@@ -1200,7 +1200,7 @@ begin
|
|
|
if (Result <> -1) then
|
|
if (Result <> -1) then
|
|
|
begin
|
|
begin
|
|
|
if OwnsObjects then
|
|
if OwnsObjects then
|
|
|
- TObject(FList[Result]).Free;
|
|
|
|
|
|
|
+ TObject(FList[Result]).Free; // no nil needed
|
|
|
FList.Delete(Result);
|
|
FList.Delete(Result);
|
|
|
end;
|
|
end;
|
|
|
end;
|
|
end;
|
|
@@ -1893,7 +1893,7 @@ var
|
|
|
begin
|
|
begin
|
|
|
if FFreeObjects then
|
|
if FFreeObjects then
|
|
|
for i := 0 to FHashList.Count - 1 do
|
|
for i := 0 to FHashList.Count - 1 do
|
|
|
- TObject(FHashList[i]).Free;
|
|
|
|
|
|
|
+ TObject(FHashList[i]).Free; // no nil needed
|
|
|
FHashList.Clear;
|
|
FHashList.Clear;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
@@ -1921,7 +1921,7 @@ end;
|
|
|
procedure TFPHashObjectList.SetItem(Index: Integer; AObject: TObject);
|
|
procedure TFPHashObjectList.SetItem(Index: Integer; AObject: TObject);
|
|
|
begin
|
|
begin
|
|
|
if OwnsObjects then
|
|
if OwnsObjects then
|
|
|
- TObject(FHashList[Index]).Free;
|
|
|
|
|
|
|
+ TObject(FHashList[Index]).Free; // no nil needed
|
|
|
FHashList[index] := AObject;
|
|
FHashList[index] := AObject;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
@@ -1958,7 +1958,7 @@ end;
|
|
|
procedure TFPHashObjectList.Delete(Index: Integer);
|
|
procedure TFPHashObjectList.Delete(Index: Integer);
|
|
|
begin
|
|
begin
|
|
|
if OwnsObjects then
|
|
if OwnsObjects then
|
|
|
- TObject(FHashList[Index]).Free;
|
|
|
|
|
|
|
+ TObject(FHashList[Index]).Free; // no nil needed
|
|
|
FHashList.Delete(Index);
|
|
FHashList.Delete(Index);
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
@@ -1979,7 +1979,7 @@ begin
|
|
|
if (Result <> -1) then
|
|
if (Result <> -1) then
|
|
|
begin
|
|
begin
|
|
|
if OwnsObjects then
|
|
if OwnsObjects then
|
|
|
- TObject(FHashList[Result]).Free;
|
|
|
|
|
|
|
+ TObject(FHashList[Result]).Free; // no nil needed
|
|
|
FHashList.Delete(Result);
|
|
FHashList.Delete(Result);
|
|
|
end;
|
|
end;
|
|
|
end;
|
|
end;
|
|
@@ -2541,6 +2541,7 @@ end;
|
|
|
begin
|
|
begin
|
|
|
inherited Remove(p);
|
|
inherited Remove(p);
|
|
|
p.Free;
|
|
p.Free;
|
|
|
|
|
+ p := nil;
|
|
|
end;
|
|
end;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
@@ -2556,6 +2557,7 @@ end;
|
|
|
begin
|
|
begin
|
|
|
GetFirst:=p.FPStr;
|
|
GetFirst:=p.FPStr;
|
|
|
p.free;
|
|
p.free;
|
|
|
|
|
+ p := nil;
|
|
|
end;
|
|
end;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
@@ -2571,6 +2573,7 @@ end;
|
|
|
begin
|
|
begin
|
|
|
Getlast:=p.FPStr;
|
|
Getlast:=p.FPStr;
|
|
|
p.free;
|
|
p.free;
|
|
|
|
|
+ p := nil;
|
|
|
end;
|
|
end;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
@@ -2985,7 +2988,7 @@ end;
|
|
|
begin
|
|
begin
|
|
|
next := item^.Next;
|
|
next := item^.Next;
|
|
|
if FOwnsObjects then
|
|
if FOwnsObjects then
|
|
|
- item^.Data.Free;
|
|
|
|
|
|
|
+ FreeAndNil(item^.Data);
|
|
|
FreeItem(item);
|
|
FreeItem(item);
|
|
|
item := next;
|
|
item := next;
|
|
|
end;
|
|
end;
|
|
@@ -3136,7 +3139,7 @@ end;
|
|
|
begin
|
|
begin
|
|
|
chain^ := Entry^.Next;
|
|
chain^ := Entry^.Next;
|
|
|
if FOwnsObjects then
|
|
if FOwnsObjects then
|
|
|
- Entry^.Data.Free;
|
|
|
|
|
|
|
+ FreeAndNil(Entry^.Data);
|
|
|
FreeItem(Entry);
|
|
FreeItem(Entry);
|
|
|
Dec(FCount);
|
|
Dec(FCount);
|
|
|
Result := True;
|
|
Result := True;
|