The WndHandle class should be responsible for destroying the FOwnerList, 
correct?? This is a bug of ICS??

I have made a fix for my version because this memory leak would compromise my 
software operation, as it will be running 24x7 and it creates and destroys 
sockets everytime
  ----- Original Message ----- 
  From: Éric Fleming Bonilha 
  To: twsocket@elists.org 
  Sent: Tuesday, April 25, 2006 5:06 PM
  Subject: ICS 6 Bug - Memory Leak


  I´m using FastMM4, by declaring FastMM4 as first unit of my project, and when 
I close my application it says that there is 1 memory leak on module 
TIcsWndHandlerList.

  This bug occurs even on the demo applications provided on ICS package

  I have read the code of unit OverbyteIcsWndControl and I found a possible bug 
on the procedure TIcsWndHandlerPool.FreeWndHandler

  procedure TIcsWndHandlerPool.FreeWndHandler(var WndHandler: TIcsWndHandler);
  var
      Index : Integer;
  begin
      if not Assigned(WndHandler.FOwnerList) then
          Exit;
      Index := WndHandler.FOwnerList.IndexOf(WndHandler);
      if Index >= 0 then begin
          WndHandler.FOwnerList.Delete(Index);
          if WndHandler.FOwnerList.Count <= 0 then begin
              Index := FList.IndexOf(WndHandler.FOwnerList);
              if Index >= 0 then
                  FList.Delete(Index);
          end;
          WndHandler.Free;
          WndHandler := nil;
      end;
  end;

  The problem is that this routine is not freeing the WndHandle.FOwnerList

  I added the code:

          WndHandle.FOwnerList.Free;
          WndHandler.Free;
          WndHandler := nil;
      end;
  end;

  just for test, and it worked fine, the memory leak message didn´t appears 
anymore, but I don´t know the impact of this code on the rest of the package 
because I don´t know the internal funcionality of ICS.

  The FOwnerList shouldn´t be freed when the WndHandle class is destroyed????

  Éric
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to