G'day all,

I'm using Postgres 8.1 and have async notifies working nicely based on select(). The problem is each time I get a notify I leak memory. I've commented out the PQfreemem call and find exactly the same size leak (tested over 10,000 notifies). I assume from that I'm doing something very wrong but I just can't see where. I've been unable to find much in the way of examples out there so I assume I'm doing something wrong.

Aside from the memory leak it all works very, very well.
(I'm using this in Lazarus but not using any of the lcl or fcl database components but the postgres3 unit directly as none of those seem to support PQsocket)

procedure chk_notify;

var
   Notify : PpgNotify;

begin
Notify := PQnotifies(conn);
while Notify <> Nil do
    Begin
      PQfreemem(Notify);
      Inc(queue)
      Notify := PQnotifies(conn);
    End;
end;

Anybody have any ideas?

Regards,
Brad
--
"Human beings, who are almost unique in having the ability
to learn from the experience of others, are also remarkable
for their apparent disinclination to do so." -- Douglas Adams
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to