Changeset - r21655:26ebae6148db
[Not reviewed]
master
0 1 0
frosch - 10 years ago 2014-09-07 13:52:20
frosch@openttd.org
(svn r26787) -Fix (r20547): Loading a game with order backups leaked Orders and left unreachable items in the pool.
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/saveload/order_sl.cpp
Show inline comments
 
@@ -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;
 
		}
 
	}
 
}
 

	
0 comments (0 inline, 0 general)