mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
handle dead commands when the connection is lost before the reply gets processed
This commit is contained in:
parent
53afd65beb
commit
e76502cf0e
4 changed files with 23 additions and 1 deletions
|
|
@ -166,8 +166,14 @@ void RemoteClient::doDisconnectFromServer()
|
|||
messageLength = 0;
|
||||
|
||||
QList<PendingCommand *> pc = pendingCommands.values();
|
||||
for (int i = 0; i < pc.size(); i++)
|
||||
for (int i = 0; i < pc.size(); i++) {
|
||||
Response response;
|
||||
response.set_response_code(Response::RespNotConnected);
|
||||
response.set_cmd_id(pc[i]->getCommandContainer().cmd_id());
|
||||
pc[i]->processResponse(response);
|
||||
|
||||
delete pc[i];
|
||||
}
|
||||
pendingCommands.clear();
|
||||
|
||||
setStatus(StatusDisconnected);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue