Charles Jensen wrote:
> > Clearly visible when ReportMemoryLeaksOnShutdown is enabled. => It seems to be related to using TIBQuery. > > Could it be because memory is allocated with GetMem/ReAllocMem (in IBAlloc) and freed by "FreeRecordBuffer" by setting the pointer to nil? > > - Charles
Yes that is a leak. change it to
procedure TIBCustomDataSet.FreeRecordBuffer(var Buffer: TRecordBuffer); begin if Assigned(Buffer) then ReallocMem(Buffer, 0); end;
For most of XE3's beta TRecordBuffer at the db.pas level was defined as Array<byte> so was allocated with SetLength and deallocated with setting it to nil. Very late in the beta it was switched back to a pointer and this line was missed (Actually someone on the dev team switched it back for me and I just verified changes, this didn't change cause they missed it so I didn't catch it either, still my fault).
-- Jeff Overcash (TeamB) (Please do not email me directly unless asked. Thank You) And so I patrol in the valley of the shadow of the tricolor I must fear evil. For I am but mortal and mortals can only die. Asking questions, pleading answers from the nameless faceless watchers that stalk the carpeted corridors of Whitehall. (Fish)