diff --git a/src/aoclient.cpp b/src/aoclient.cpp index 257410d..14951b9 100644 --- a/src/aoclient.cpp +++ b/src/aoclient.cpp @@ -64,6 +64,7 @@ void AOClient::clientDisconnected() false; server->updateCharsTaken(server->areas[current_area]); } + cleanup(); } void AOClient::handlePacket(AOPacket packet) diff --git a/src/server.cpp b/src/server.cpp index 74c43b0..f10281c 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -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);