(websocket client) reset WebSocketTransport onClose callback in the WebSocket destructor
This commit is contained in:
		@@ -1,6 +1,10 @@
 | 
			
		||||
# Changelog
 | 
			
		||||
All changes to this project will be documented in this file.
 | 
			
		||||
 | 
			
		||||
## [9.10.2] - 2020-07-24
 | 
			
		||||
 | 
			
		||||
(websocket client) reset WebSocketTransport onClose callback in the WebSocket destructor
 | 
			
		||||
 | 
			
		||||
## [9.10.1] - 2020-07-24
 | 
			
		||||
 | 
			
		||||
(websocket server) reset client websocket callback when the connection is closed
 | 
			
		||||
 
 | 
			
		||||
@@ -46,6 +46,7 @@ namespace ix
 | 
			
		||||
    WebSocket::~WebSocket()
 | 
			
		||||
    {
 | 
			
		||||
        stop();
 | 
			
		||||
        _ws.setOnCloseCallback(nullptr);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void WebSocket::setUrl(const std::string& url)
 | 
			
		||||
 
 | 
			
		||||
@@ -180,7 +180,10 @@ namespace ix
 | 
			
		||||
        if (readyState == ReadyState::CLOSED)
 | 
			
		||||
        {
 | 
			
		||||
            std::lock_guard<std::mutex> lock(_closeDataMutex);
 | 
			
		||||
            if (_onCloseCallback)
 | 
			
		||||
            {
 | 
			
		||||
                _onCloseCallback(_closeCode, _closeReason, _closeWireSize, _closeRemote);
 | 
			
		||||
            }
 | 
			
		||||
            _closeCode = WebSocketCloseConstants::kInternalErrorCode;
 | 
			
		||||
            _closeReason = WebSocketCloseConstants::kInternalErrorMessage;
 | 
			
		||||
            _closeWireSize = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -6,4 +6,4 @@
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#define IX_WEBSOCKET_VERSION "9.10.1"
 | 
			
		||||
#define IX_WEBSOCKET_VERSION "9.10.2"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user