summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-09-07 13:52:20 +0000
committerfrosch <frosch@openttd.org>2014-09-07 13:52:20 +0000
commit9b72a9f6b804fd3bad86e156fea53776eef4b480 (patch)
tree3b02e907a398e79ff39515ebe154f176b3f4f36e /src
parent937265d6d67d7e96f0144cd5083fe675b14149c5 (diff)
downloadopenttd-9b72a9f6b804fd3bad86e156fea53776eef4b480.tar.xz
(svn r26787) -Fix (r20547): Loading a game with order backups leaked Orders and left unreachable items in the pool.
Diffstat (limited to 'src')
-rw-r--r--src/saveload/order_sl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/saveload/order_sl.cpp b/src/saveload/order_sl.cpp
index d93974234..ba1f79c38 100644
--- a/src/saveload/order_sl.cpp
+++ b/src/saveload/order_sl.cpp
@@ -302,7 +302,12 @@ void Load_BKOR()
* Furthermore before savegame version 192 the actual content was always corrupt.
*/
if (!_networking || _network_server || IsSavegameVersionBefore(192)) {
- _order_backup_pool.CleanPool();
+ /* Note: We cannot use CleanPool since that skips part of the destructor
+ * and then leaks un-reachable Orders in the order pool. */
+ OrderBackup *ob;
+ FOR_ALL_ORDER_BACKUPS(ob) {
+ delete ob;
+ }
}
}