fix race condition to delete websocket proxy object
This commit is contained in:
parent
03db6ff7dd
commit
14f442be6c
@ -44,7 +44,6 @@ void WSClient::onTcpData()
|
|||||||
void WSClient::onWsDisconnect()
|
void WSClient::onWsDisconnect()
|
||||||
{
|
{
|
||||||
tcp_socket->disconnectFromHost();
|
tcp_socket->disconnectFromHost();
|
||||||
tcp_socket->close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WSClient::onTcpDisconnect()
|
void WSClient::onTcpDisconnect()
|
||||||
|
@ -47,10 +47,6 @@ void WSProxy::wsConnected()
|
|||||||
connect(new_tcp, &QTcpSocket::readyRead, client, &WSClient::onTcpData);
|
connect(new_tcp, &QTcpSocket::readyRead, client, &WSClient::onTcpData);
|
||||||
connect(new_ws, &QWebSocket::disconnected, client, &WSClient::onWsDisconnect);
|
connect(new_ws, &QWebSocket::disconnected, client, &WSClient::onWsDisconnect);
|
||||||
connect(new_tcp, &QTcpSocket::disconnected, client, &WSClient::onTcpDisconnect);
|
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, [=] {
|
connect(new_tcp, &QTcpSocket::disconnected, this, [=] {
|
||||||
clients.removeAll(client);
|
clients.removeAll(client);
|
||||||
client->deleteLater();
|
client->deleteLater();
|
||||||
|
Loading…
Reference in New Issue
Block a user