Memory leaks in Indy?

Giganews Newsgroups
Subject: Memory leaks in Indy?
Posted by:  Arnau Font (afont@nospam-ipssoft.com)
Date: Thu, 27 Nov 2003

Hi, I'm using Indy 9 (the one distributed with delphi 7) in a server
application.
I have a TIdTCPServer to listen to the clients.
It works perfectly, but I've passed thru a debugger (AQTime 3) and it has
found several memory leaks in the TIdThread.Execute, always in the
IdSocketHandle, in this line:

function TIdSocketHandle.Select(ASocket: TIdStackSocketHandle; ATimeOut:
Integer): boolean;
var
  ReadList: TList;
begin
  ReadList := TList.Create; try
  ReadList.Add(Pointer(ASocket)); //>>>> HERE!!!!
  Result := GStack.WSSelect(ReadList, nil, nil, ATimeOut) = 1;
  TIdAntiFreezeBase.DoProcess(result = false);
  finally
    ReadList.free;
  end;
end;

The leak is actually in the TList.SetCapacity procedure.

There is also another in the IdServerIOHandlerSocket, in the
TObject.NewInstance.

Does anybody know anything about this??? I need a very stable application,
so memory leaks should be avoided when possible.

Thanks!

Arnau.

Replies