mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
Subject: [PATCH 1/2] fix win32 context memory leak
This commit is contained in:
parent
467b5bb4a0
commit
dd020b4b04
1 changed files with 10 additions and 2 deletions
|
@ -164,7 +164,11 @@ libwebsocket_create_context(struct lws_context_creation_info *info)
|
|||
#endif
|
||||
|
||||
if (lws_plat_init_fd_tables(context)) {
|
||||
#ifndef _WIN32
|
||||
#ifdef _WIN32
|
||||
for (i = 0; i < FD_HASHTABLE_MODULUS; i++) {
|
||||
lws_free(context->fd_hashtable[i].wsi);
|
||||
}
|
||||
#else
|
||||
lws_free(context->lws_lookup);
|
||||
#endif
|
||||
lws_free(context->fds);
|
||||
|
@ -339,7 +343,11 @@ libwebsocket_context_destroy(struct libwebsocket_context *context)
|
|||
lws_ssl_context_destroy(context);
|
||||
|
||||
lws_free(context->fds);
|
||||
#ifndef _WIN32
|
||||
#ifdef _WIN32
|
||||
for (n = 0; n < FD_HASHTABLE_MODULUS; n++) {
|
||||
lws_free(context->fd_hashtable[n].wsi);
|
||||
}
|
||||
#else
|
||||
lws_free(context->lws_lookup);
|
||||
#endif
|
||||
lws_plat_context_late_destroy(context);
|
||||
|
|
Loading…
Add table
Reference in a new issue