> On Sep 7, 2020, at 6:07 AM, James Richters via fpc-pascal 
> <fpc-pascal@lists.freepascal.org> wrote:
> 
> Does anyone have an example of how to use TFPObjectlist?  

It just frees objects that are removed from the list (or when the list is 
freed).

list:= TFPObjectlist.Create;
list.Add(TObject.Create);
list.Free;

in that example the object added to the list won't leak memory but it will be 
freed when the list itself is freed.

or

list:= TFPObjectlist.Create;
list.Add(TObject.Create);
list.Delete(0);

will also not leak memory.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to