var
List: TObjectList<TNewObject>;
Obj: TNewObject;
begin
Obj := TNewObject.Create('Three');
List := TObjectList<TNewObject>.Create();
List.Add(TNewObject.Create('One'));
List.Add(Obj);
Obj.free; //手动释放
List.Pack(function(const L, R: TNewObject): Boolean begin result:= L = nil; end) //如何判断L是否释放
List.Free
readln;
end.
List: TObjectList<TNewObject>;
Obj: TNewObject;
begin
Obj := TNewObject.Create('Three');
List := TObjectList<TNewObject>.Create();
List.Add(TNewObject.Create('One'));
List.Add(Obj);
Obj.free; //手动释放
List.Pack(function(const L, R: TNewObject): Boolean begin result:= L = nil; end) //如何判断L是否释放
List.Free
readln;
end.