summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/webchannel/shared/websockettransport.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/webchannel/shared/websockettransport.cpp b/examples/webchannel/shared/websockettransport.cpp
index 8ed330c..f484a24 100644
--- a/examples/webchannel/shared/websockettransport.cpp
+++ b/examples/webchannel/shared/websockettransport.cpp
@@ -60,6 +60,8 @@ WebSocketTransport::WebSocketTransport(QWebSocket *socket)
{
connect(socket, &QWebSocket::textMessageReceived,
this, &WebSocketTransport::textMessageReceived);
+ connect(socket, &QWebSocket::disconnected,
+ this, &WebSocketTransport::deleteLater);
}
/*!
@@ -67,7 +69,7 @@ WebSocketTransport::WebSocketTransport(QWebSocket *socket)
*/
WebSocketTransport::~WebSocketTransport()
{
-
+ m_socket->deleteLater();
}
/*!