#1 2015-07-20 12:24:17

hnb
Member
Registered: 2015-06-15
Posts: 290

TAutoFree for FPC

My suggestion is to upgrade information about using TAutoFree. I don't have any problems with that in FPC. Delphi implementation/behavior for releasing of returned interfaces from methods is IMO buggy, correct using of TAutoFree IMO should be presented as:

with TAutoFree.One(r, TSQLSomeRecord.CreateAndFillPrepare(...)) do
  while r.FillOne do
    GSlaveServer.Add(r, true, false); 

best regards,
Maciej Izak

Last edited by hnb (2015-07-20 12:25:02)


best regards,
Maciej Izak

Offline

#2 2015-07-22 11:37:26

hnb
Member
Registered: 2015-06-15
Posts: 290

Re: TAutoFree for FPC

Bad idea? Using additional Interface variable for TAutoFree in FPC is uncomfortable. "with" is solving this problem.


best regards,
Maciej Izak

Offline

Board footer

Powered by FluxBB