BTW: Also this returns TRUE for both windows: function XSocketDeallocateHWnd(Wnd: HWND): boolean; begin Result := (SetWindowLong(Wnd, 0, 0) <> 0) and DestroyWindow(Wnd); end;
Arno Garrels wrote: > Fastream Technologies wrote: >> I found the ICS bug: when I put the below in the ThttpCli descendent's >> destructor, it works: >> >> SetWindowLong(FWindowHandle, 0, 0); >> DestroyWindow(FWindowHandle); >> SetWindowLong(FCtrlSocket->Handle, 0, 0); >> DestroyWindow(FCtrlSocket->Handle); >> >> In THttpCli destructor, the destruction order of the CTrlSocket is first >> so I think that's why it leaks the window. And no, >> CodeGuard/Memproof/Eurekalog cannot show undeleted windows. > > In WSocket.pas, XSocketDeallocateHWnd, there should be a call to > SetWindowLong(). > > function XSocketDeallocateHWnd(Wnd: HWND): boolean; > begin > SetWindowLong(Wnd, 0, 0); { Clear the object reference } > Result := DestroyWindow(Wnd); > end; > > If not, make sure that you have latest ICS-Beta installed (not > sure if it is in the release). I've my doubts that order of > destroying the windows matters, but not 100% sure. > > --- > Arno Garrels [TeamICS] > http://www.overbyte.be/eng/overbyte/teamics.html > > >> Best Regards, >> >> SZ >> >> ----- Original Message ----- >> From: "Arno Garrels" <[EMAIL PROTECTED]> >> To: "ICS support mailing" <twsocket@elists.org> >> Sent: Saturday, February 04, 2006 1:28 PM >> Subject: Re: [twsocket] Remember the SetWindowLong bug in WSocket? >> >> >>> Fastream Technologies wrote: >>>> Hello, >>>> >>>> That bug caused a lot of frustration here. Now the problem is resolved >>>> for >>>> FTP and web servers with my fix BUT for the reverse proxy, there is a >>>> window leakage that cannot be detected by CodeGuard. It seems the >>>> problem is in THttpCli destructor. XWindowDealloc returns true but I >>>> have BIG doubts. It is a bit confusing because in THttpCli there are >>>> two handles and two windows! One is for the THttpCli and the other one >>>> is for THttpCli->CtrlSocket. Could someone take a look? It leaks 40KB >>>> per socket!!! >>> >>> Have you cross-checked one of the THttpCli demo projects? >>> Here MemProof says "No leak found" (beside 1x 4k in MakeObjectInstance >>> which >>> is normal..). >>> >>> --- >>> Arno Garrels [TeamICS] >>> http://www.overbyte.be/eng/overbyte/teamics.html >>> >>> >>>> >>>> Best Regards, >>>> >>>> SZ >>> -- >>> 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 -- 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