mirror of https://github.com/OpenTTD/OpenTTD
(svn r22069) -Fix: delete all savegame packets, not just the first one
parent
adfd648031
commit
a19bc28aba
|
@ -178,14 +178,18 @@ ServerNetworkGameSocketHandler::~ServerNetworkGameSocketHandler()
|
||||||
OrderBackup::ResetUser(this->client_id);
|
OrderBackup::ResetUser(this->client_id);
|
||||||
|
|
||||||
if (this->savegame_mutex != NULL) this->savegame_mutex->BeginCritical();
|
if (this->savegame_mutex != NULL) this->savegame_mutex->BeginCritical();
|
||||||
delete this->savegame_packets;
|
|
||||||
if (this->savegame != NULL) this->savegame->cs = NULL;
|
if (this->savegame != NULL) this->savegame->cs = NULL;
|
||||||
|
|
||||||
if (this->savegame_mutex != NULL) this->savegame_mutex->EndCritical();
|
if (this->savegame_mutex != NULL) this->savegame_mutex->EndCritical();
|
||||||
|
|
||||||
/* Make sure the saving is completely cancelled. */
|
/* Make sure the saving is completely cancelled. */
|
||||||
if (this->savegame != NULL) WaitTillSaved();
|
if (this->savegame != NULL) WaitTillSaved();
|
||||||
|
|
||||||
|
while (this->savegame_packets != NULL) {
|
||||||
|
Packet *p = this->savegame_packets->next;
|
||||||
|
delete this->savegame_packets;
|
||||||
|
this->savegame_packets = p;
|
||||||
|
}
|
||||||
|
|
||||||
delete this->savegame_mutex;
|
delete this->savegame_mutex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue