I have posted a message days ago and no one has told anything, please, the 
problem specified here is not a bug of my application, is a possible bug of ICS 
that must be corrected, this is a memory leak bug that I found on the 
FreeWndHandler routine of ICS, can any ICS Team members or even François Piette 
give a feedback on this??? The message is below:

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:

        if WndHandler.FOwnerList.Count <= 0 then begin
            Index := FList.IndexOf(WndHandler.FOwnerList);
            if Index >= 0 then
                FList.Delete(Index);

            WndHandle.FOwnerList.Free;
        end;
        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????

Please, I need a feedback on this because my application runs 24/7 and creates 
and destroys sockets frequently, and this bug leaks memory each time a socket 
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