diff options
author | Frank Meerkoetter <frank.meerkoetter@basyskom.com> | 2015-08-18 11:29:46 +0200 |
---|---|---|
committer | Frank Meerkoetter <frank.meerkoetter@basyskom.com> | 2015-08-19 17:50:19 +0000 |
commit | be6a3904012d0e430cd79758da8fb535c9f970e6 (patch) | |
tree | 2a75dc7c49b013bc7d50fbbcf431e298d9616abd /examples/webchannel/shared | |
parent | 3260efe1b6a28ef81226756d2f24a2c73b2c1450 (diff) | |
download | qtwebchannel-be6a3904012d0e430cd79758da8fb535c9f970e6.tar.gz |
Remove transports when the underlying socket gets disconnect
This will cause the transport to be removed from the "transports" member
of the QQmlWebChannel. Otherwise it would linger around eating resources.
Thanks to Jannis Voelker for pointing it out.
Change-Id: I5aca499dfd0bdefc075fa5717436ab0919ec6ab1
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Diffstat (limited to 'examples/webchannel/shared')
-rw-r--r-- | examples/webchannel/shared/websockettransport.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/webchannel/shared/websockettransport.cpp b/examples/webchannel/shared/websockettransport.cpp index 4e1c3d5..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); } /*! |