diff --git a/lib/context.c b/lib/context.c index ebd0e1a9..635bb137 100644 --- a/lib/context.c +++ b/lib/context.c @@ -310,7 +310,7 @@ libwebsocket_context_destroy(struct libwebsocket_context *context) * give all extensions a chance to clean up any per-context * allocations they might have made */ - if (context->listen_port) { + if (context->listen_port != CONTEXT_PORT_NO_LISTEN) { if (lws_ext_callback_for_each_extension_type(context, NULL, LWS_EXT_CALLBACK_SERVER_CONTEXT_DESTRUCT, NULL, 0) < 0) return; diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index ea40fa1f..a3ed207d 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -913,9 +913,10 @@ struct libwebsocket_extension { /** * struct lws_context_creation_info: parameters to create context with * - * @port: Port to listen on... you can use 0 to suppress listening on - * any port, that's what you want if you are not running a - * websocket server at all but just using it as a client + * @port: Port to listen on... you can use CONTEXT_PORT_NO_LISTEN to + * suppress listening on any port, that's what you want if you are + * not running a websocket server at all but just using it as a + * client * @iface: NULL to bind the listen socket to all interfaces, or the * interface name, eg, "eth2" * @protocols: Array of structures listing supported protocols and a protocol-