Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
procedure SomeObjectCreatingProcedureWithNoMemLeaks;
var ObjectList : TObjectList;
StringList : TStringList;
Index : Integer;
begin
ObjectList := TObjectList.Create(True);
try
for Index := 1 to 1000 do
begin
StringList := TStringList.Create;
ObjectList.Add(StringList);
end;
finally
FreeAndNil(ObjectList); // this will destroy the objectlist, but also the items it owns
end;
end;
Again, doesn't the (*automatic*) Application object do that for you?
It's precisely VCL objects that Application.Terminate (and closing the main form) clean up. As long as a form is the parent, it's cleaned up.whosrdaddy said:you can do it for components, but not for the smaller (vcl and others) objects that are not components...