fix race condition to delete websocket proxy object

This commit is contained in:
scatterflower 2020-09-02 09:29:40 -05:00
parent 03db6ff7dd
commit 14f442be6c
2 changed files with 0 additions and 5 deletions

View File

@ -44,7 +44,6 @@ void WSClient::onTcpData()
void WSClient::onWsDisconnect()
{
tcp_socket->disconnectFromHost();
tcp_socket->close();
}
void WSClient::onTcpDisconnect()

View File

@ -47,10 +47,6 @@ void WSProxy::wsConnected()
connect(new_tcp, &QTcpSocket::readyRead, client, &WSClient::onTcpData);
connect(new_ws, &QWebSocket::disconnected, client, &WSClient::onWsDisconnect);
connect(new_tcp, &QTcpSocket::disconnected, client, &WSClient::onTcpDisconnect);
connect(new_ws, &QWebSocket::disconnected, this, [=] {
clients.removeAll(client);
client->deleteLater();
});
connect(new_tcp, &QTcpSocket::disconnected, this, [=] {
clients.removeAll(client);
client->deleteLater();