Hi,
There are some strange memleaks when using heaptrc (-gh), visible under
gkt,gtk2 & qt under linux (possible that this errors doesn't exist under
win32 etc).
Scenario:
TForm with few buttons and virtualtree.
Database connection is via Zeos components.
Dynamic array is filled with database results, and then populated into
VirtualStringTree.
type TTest = record
Item: String;
Tip: String;
Datum: String;
Msg: String;
end;
PTTest = Array of TTest;
var
FRec: PTTest;
filling array with results:
SetLength(FRec, ZeosQuery.RecordCount);
for i := 1 to ZeosQuery.RecordCount do
begin
FRec[i - 1].Item := ZeosQuery.FieldByName('item').AsString;
FRec[i - 1].Tip := ZeosQuery.FieldByName('tip').AsString;
FRec[i - 1].Datum := ZeosQuery.FieldByName('datum').AsString;
FRec[i - 1].Msg := ZeosQuery.FieldByName('msg').AsString;
ZeosQuery.Next;
end;
ZeosQuery.Active := False;
* Now I fill FRec into VirtualTree, and everything is fine, but after closing
app there's a bunch of memleaks reported by heaptrc ( RecordCount * 4 ...
each member of TTest).
* If I fill FRec by const strings (by hand) , there's no memleak report by
heaptrc.
eg.
FRec[i - 1].Item := IntToStr(i);
FRec[i - 1].Tip := 'TIP';
FRec[i - 1].Datum := 'DATUM';
FRec[i - 1].Msg := 'SOME MSG';
If I don't fill virtualtree everything is OK.
if I fill virtualtree by dummy data everything is OK.
So there's no memleak in virtualtree or using dynamic arrays, but again
problem exists, and I'm wondering is it a real problem or heaptrc bug ?
any suggestion ?
compiler fpc 2.2.0 and 2_2_fixes, same result.
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives