[Lazarus] typinfo routine gives memory leak

Martin lazarus at mfriebe.de
Tue Sep 20 23:02:49 CEST 2011


On 20/09/2011 21:59, Howard Page-Clark wrote:
> The following (button and memo) program loses 276 bytes heap memory 
> that are not recovered.
>
...
> procedure TForm1.BGetPropertiesClick(Sender: TObject);
> var ppl: PPropList;
>     pl: TPropList;
>     ppi: PPropInfo;
>     pi: TPropInfo;
> begin
>   GetPropList(TEdit, ppl);
>   pl := ppl^;
>   ppi := pl[0];
>   pi := ppi^;
>   if PropIsType(TEdit, pi.Name, tkAString) then
>   ShowMessageFmt('TEdit''s first PropList entry is %s of 
> tkAString',[pi.Name]);
> end;
>
> end.
>
> Anyone know what I'm doing wrong?
afaik you need to

FreeMem(ppl);




More information about the Lazarus mailing list