Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- From: "Eugene Gershnik" <gershnik@xxxxxxxxxxx>
- Date: Tue, 23 Aug 2005 17:40:48 -0700
Roger Garrett wrote:
> pSocket->Detach();
This most likely detaches a C++ CSocket object from OS SOCKET. (I don't know
what exactly CSocket does but this is the usual MFC naming convention)
> pSocket->Close();
This is probably no-op as there is no SOCKET to close in CSocket anymore
> delete pSocket;
And this destroys C++ object while the OS SOCKETS continues to live ;-)
If I am right it gives another reason why MFC's use of double-state
anti-pattern is a huge mistake.
--
Eugene
http://www.gershnik.com
> }
>
> That is, it merely allocates a CSocket and then deletes it.
> Wnen I go through this loop I can watch the memory usage go up and up.
> Clearly, the delete of the CSocket is not entirely deleting
> everything.
>
> SAME PROBLEM WITH CAsyncSocket
>
> I also tried the very same kind of thing with CAsyncSocket and I get
> the very same symptoms, of memory constantly increasing for the app.
>
> Is there a solution to the problem of not fully deleting CSockets or
> CAsyncSockets?
>
> I really need some help on this.
.
- Follow-Ups:
- Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- From: Arkady Frenkel
- Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- From: Arkady Frenkel
- Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- References:
- HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- From: Roger Garrett
- HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- Prev by Date: Mailslots: Difference between NT4 and Windows 2000/XP
- Next by Date: how can i get the right dhcp state of the network adapter in winme
- Previous by thread: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- Next by thread: Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- Index(es):
Relevant Pages
|
Loading