[Lazarus] Memory leak in dbgrids?

Luca Olivetti luca at wetron.es
Fri May 10 10:08:09 CEST 2013

Al 10/05/13 09:36, En/na Luca Olivetti ha escrit:
> Al 10/05/13 09:13, En/na Luca Olivetti ha escrit:
>> Hello,
>> I'm migrating some programs from lazarus 0.9.30 to lazarus 1.0.8 (well,
>> actually updating and recompiling, there's no need to migrate anything).
>> Heaptrc is showing some memory leaks in dbgrid, though it doesn't
>> pinpoint the line exactly.
>> I think the leak is due to the change of type from TBookarkStr to
>> TBookmark, and dbgrids calls GetBookmark but never calls FreeBookmark
>> (it either discards the bookmark in local functions or assigns nil to it).
>> I'll try calling FreeBookmark and see if the leak goes away.
> Mmh, actually it does, because FKeyBoomark is assigned nil only after
> clearing the list of selected records.
> Maybe the problem comes from the version of zeos in case it returns a
> different pointer for the same record?

Now I made a test project using SQLdb instead of zeos and the leak is
still there.
It happens with multiselect, each new selection increases the non-freed
block count.

Luca Olivetti
Wetron Automation Technology http://www.wetron.es
Tel. +34 935883004  Fax +34 935883007

More information about the Lazarus mailing list