summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-02-12 21:29:35 +0000
committerrubidium <rubidium@openttd.org>2011-02-12 21:29:35 +0000
commita19bc28aba6ec682f74ad7f8f0fd8104bdece3af (patch)
tree752f2ab573b75488463eb15a4712d8f9aea9f0da /src/network
parentadfd64803108b0f418a5f5cb4ea96b25d2eaa45c (diff)
downloadopenttd-a19bc28aba6ec682f74ad7f8f0fd8104bdece3af.tar.xz
(svn r22069) -Fix: delete all savegame packets, not just the first one
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_server.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index d465078a7..7e870d1c3 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -178,14 +178,18 @@ ServerNetworkGameSocketHandler::~ServerNetworkGameSocketHandler()
OrderBackup::ResetUser(this->client_id);
if (this->savegame_mutex != NULL) this->savegame_mutex->BeginCritical();
- delete this->savegame_packets;
if (this->savegame != NULL) this->savegame->cs = NULL;
-
if (this->savegame_mutex != NULL) this->savegame_mutex->EndCritical();
/* Make sure the saving is completely cancelled. */
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;
}