Do not double-delete the TCP socket of a QWebSocket.
authorMilian Wolff <mail@milianw.de>
Thu, 6 Feb 2014 16:48:28 +0000 (17:48 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 6 Feb 2014 19:17:30 +0000 (20:17 +0100)
commitdaf0faa0930b72a78ff940ecbf2a5eb8930fd793
tree466f41353d4aa9c99c4303702673bd3cffe51b49
parent862ac1547c19b02fc36bdc4b6ce5c6cf3442a868
Do not double-delete the TCP socket of a QWebSocket.

The socket is put into an owning QScopedPointer. But if its also
put into the QObject parent-child chain, it will get deleted when
the QWebSocket is destroyed. In the dtor of the QWebSocketPrivate
class m_pSocket will thus already be destroyed and thus be a
dangling pointer.

This crashed the QWebSocketServer test reliably for me on exit.

Change-Id: I7f06e933bfed832e66b943542c351cde639c9465
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
src/websockets/qwebsocket_p.cpp