qwebsocket

Is the QTcpSocket (or QSslSocket) which underlies a QWebSocket — destroyed by itself when a socket error happens?

混江龙づ霸主 提交于 2019-12-23 18:17:40
问题 When a QTcpSocket (or QSslSocket ) is upgraded to a QWebSocket , the former has to be stored for the future purpose, as it requires to be ... moved to the same thread wherever QWebSocket is being moveToThread() deleteLater() whenever QWebSocket is being destroyed Failing to do 1. results in undefined behaviour and most likely a crash. While failing to do 2. results in a memory leak, which is more prominent if you are having a QWebSocketServer (QWebSocketServer - not releasing memory). I