|Subject:||Re: [osip-dev] WSACleanup missing|
|Date:||Thu, 8 Jan 2015 11:10:49 +0100|
happy new year !
let me try it one more time:
the current eXosip behaviour is asymmetrical – eXosip does call WSAStartup, but never calls WSACleanup.
this is ‘sub-optimal’ in my opinion – either call both, or none.
fact is, that WSAStartup and WSACleanup are counting internally how often they have been called.
so, the first WSAStartup initializes the sockets, the last WSACleanup destroys them.
every application and lib that uses sockets under windows shall call itself WSAStartup and WSACleanup;
eXosip does – so it shall call both functions.
independent of the applications, which may use the windows socket lib or not.
when calling WSAStartup without WSACleanup any memleak-search-tool identifies this as leak,
because WSAStartup does some memory allocaction.
btw, I don’t know if there is a limit, how often WSAStartup may be called.
if eXosip_init permanently fails, let’s assume for days and weeks, it might come to a point, where
this internal counter may be exhausted …
I don’t think you break existing application – it just fixes a memleak.
I don't think this can be integrated without breaking some existing
applications. A clean change would be to remove the WSAStartup
which would also break apps...
So... I prefer to keep everything unchanged on that topic!
Not your fault ;)
2014-12-22 12:25 GMT+01:00 FEICHTER Christoph <address@hidden>:
one more improvement for eXosip:
since eXosip calls WSAStartup, but never WSACleanup, this causes a memory/handle leak.
I would suggest to add the following in eXosip_quit:
#if !(OPENSSL_VERSION_NUMBER < 0x00908000L)
memset (excontext, 0, sizeof (eXosip_t));
excontext->j_stop_ua = -1;
Antisip - http://www.antisip.com
|[Prev in Thread]||Current Thread||[Next in Thread]|