[Lazarus] typinfo routine gives memory leak

Howard Page-Clark hdpc at talktalk.net
Wed Sep 21 08:09:05 CEST 2011


On 20/9/11 10:02, Martin wrote:
> 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);
>
Many thanks

H.




More information about the Lazarus mailing list