fix memory leak from incorrect delete call

This commit is contained in:
scatterflower 2020-09-03 01:03:41 -05:00
parent 849a74fdc3
commit 20276891e6
2 changed files with 2 additions and 1 deletions

View File

@ -64,6 +64,7 @@ void AOClient::clientDisconnected()
false;
server->updateCharsTaken(server->areas[current_area]);
}
cleanup();
}
void AOClient::handlePacket(AOPacket packet)

View File

@ -83,7 +83,7 @@ void Server::clientConnected()
connect(socket, &QTcpSocket::disconnected, this, [=] {
qDebug() << "removed client" << client->getIpid();
clients.removeAll(client);
delete client;
client->deleteLater();
});
connect(socket, &QTcpSocket::readyRead, client, &AOClient::clientData);