summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocketserver_p.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/websockets/qwebsocketserver_p.cpp')
-rw-r--r--src/websockets/qwebsocketserver_p.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/websockets/qwebsocketserver_p.cpp b/src/websockets/qwebsocketserver_p.cpp
index 91bfafc..3bf6d68 100644
--- a/src/websockets/qwebsocketserver_p.cpp
+++ b/src/websockets/qwebsocketserver_p.cpp
@@ -392,18 +392,20 @@ void QWebSocketServerPrivate::onNewConnection()
QObjectPrivate::connect(pTcpSocket, &QTcpSocket::readyRead,
this, &QWebSocketServerPrivate::handshakeReceived,
Qt::QueuedConnection);
+ QObjectPrivate::connect(pTcpSocket, &QTcpSocket::disconnected,
+ this, &QWebSocketServerPrivate::onSocketDisconnected);
}
}
/*!
\internal
*/
-void QWebSocketServerPrivate::onCloseConnection()
+void QWebSocketServerPrivate::onSocketDisconnected()
{
if (Q_LIKELY(currentSender)) {
QTcpSocket *pTcpSocket = qobject_cast<QTcpSocket*>(currentSender->sender);
if (Q_LIKELY(pTcpSocket))
- pTcpSocket->close();
+ pTcpSocket->deleteLater();
}
}