mirror of https://github.com/OpenTTD/OpenTTD
(svn r26043) -Fix [FS#5811]: occasional hanging when client joins
parent
ae7b830964
commit
1a043202d1
|
@ -113,6 +113,12 @@ struct PacketWriter : SaveFilter {
|
||||||
if (this->mutex != NULL) this->mutex->SendSignal();
|
if (this->mutex != NULL) this->mutex->SendSignal();
|
||||||
|
|
||||||
if (this->mutex != NULL) this->mutex->EndCritical();
|
if (this->mutex != NULL) this->mutex->EndCritical();
|
||||||
|
|
||||||
|
/* Make sure the saving is completely cancelled. Yes,
|
||||||
|
* we need to handle the save finish as well as the
|
||||||
|
* next connection might just be requesting a map. */
|
||||||
|
WaitTillSaved();
|
||||||
|
ProcessAsyncSaveFinish();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -236,13 +242,6 @@ ServerNetworkGameSocketHandler::~ServerNetworkGameSocketHandler()
|
||||||
this->savegame->Destroy();
|
this->savegame->Destroy();
|
||||||
this->savegame = NULL;
|
this->savegame = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure the saving is completely cancelled.
|
|
||||||
* Yes, we need to handle the save finish as well
|
|
||||||
* as the next connection in this "loop" might
|
|
||||||
* just be requesting the map and such. */
|
|
||||||
WaitTillSaved();
|
|
||||||
ProcessAsyncSaveFinish();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Packet *ServerNetworkGameSocketHandler::ReceivePacket()
|
Packet *ServerNetworkGameSocketHandler::ReceivePacket()
|
||||||
|
@ -622,8 +621,6 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap()
|
||||||
this->savegame->Destroy();
|
this->savegame->Destroy();
|
||||||
this->savegame = NULL;
|
this->savegame = NULL;
|
||||||
|
|
||||||
WaitTillSaved();
|
|
||||||
|
|
||||||
/* Set the status to DONE_MAP, no we will wait for the client
|
/* Set the status to DONE_MAP, no we will wait for the client
|
||||||
* to send it is ready (maybe that happens like never ;)) */
|
* to send it is ready (maybe that happens like never ;)) */
|
||||||
this->status = STATUS_DONE_MAP;
|
this->status = STATUS_DONE_MAP;
|
||||||
|
|
Loading…
Reference in New Issue