diff options
author | frosch <frosch@openttd.org> | 2014-09-07 13:52:20 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2014-09-07 13:52:20 +0000 |
commit | 9b72a9f6b804fd3bad86e156fea53776eef4b480 (patch) | |
tree | 3b02e907a398e79ff39515ebe154f176b3f4f36e /src | |
parent | 937265d6d67d7e96f0144cd5083fe675b14149c5 (diff) | |
download | openttd-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.cpp | 7 |
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; + } } } |