From c26a2d5d39553b5ba9ac73da92be747fe9a68bc1 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Fri, 24 Jul 2020 09:41:02 -0700 Subject: [PATCH] (websocket server) reset client websocket callback when the connection is closed --- docs/CHANGELOG.md | 4 ++++ ixwebsocket/IXWebSocketServer.cpp | 2 ++ ixwebsocket/IXWebSocketVersion.h | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4751c5da..832e3992 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All changes to this project will be documented in this file. +## [9.10.1] - 2020-07-24 + +(websocket server) reset client websocket callback when the connection is closed + ## [9.10.0] - 2020-07-23 (websocket server) add a new simpler API to handle client connections / that API does not trigger a memory leak while the previous one did diff --git a/ixwebsocket/IXWebSocketServer.cpp b/ixwebsocket/IXWebSocketServer.cpp index 16fbde63..4e9746a1 100644 --- a/ixwebsocket/IXWebSocketServer.cpp +++ b/ixwebsocket/IXWebSocketServer.cpp @@ -136,6 +136,8 @@ namespace ix logError(ss.str()); } + webSocket->setOnMessageCallback(nullptr); + // Remove this client from our client set { std::lock_guard lock(_clientsMutex); diff --git a/ixwebsocket/IXWebSocketVersion.h b/ixwebsocket/IXWebSocketVersion.h index 13ebb6c4..3a801255 100644 --- a/ixwebsocket/IXWebSocketVersion.h +++ b/ixwebsocket/IXWebSocketVersion.h @@ -6,4 +6,4 @@ #pragma once -#define IX_WEBSOCKET_VERSION "9.10.0" +#define IX_WEBSOCKET_VERSION "9.10.1"