1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2025-12-23 13:12:40 +01:00

(svn r8179) -Backport from trunk (r8065, r8101, r8119, r8123, r8140, r8150):

- The station list does now remember the sort settings (r8065)
 - Uninitializing windows calls WE_DESTROY to free dynamic memory used (r8101, r8119)
 - (FS#538) Findfirstbit returns first bit (bouys now numbered 1..9) (r8123)
 - FS#54) Combat helicopter shoots from right position, (r8140)
 - Submarine disaster did not move around (r8158)
This commit is contained in:
Darkvater
2007-01-17 01:02:51 +00:00
parent c73bbe531e
commit 40245ce496
5 changed files with 40 additions and 29 deletions

View File

@@ -253,9 +253,15 @@ static void InitializeDynamicVariables(void)
_industry_sort = NULL;
}
static void UnInitializeDynamicVariables(void)
static void UnInitializeGame(void)
{
/* Dynamic stuff needs to be free'd somewhere... */
UnInitWindowSystem();
/* Uninitialize airport state machines */
UnInitializeAirports();
/* Uninitialize variables that are allocated dynamically */
CleanPool(&_Town_pool);
CleanPool(&_Industry_pool);
CleanPool(&_Station_pool);
@@ -265,11 +271,6 @@ static void UnInitializeDynamicVariables(void)
free((void*)_town_sort);
free((void*)_industry_sort);
}
static void UnInitializeGame(void)
{
UnInitWindowSystem();
free(_config_file);
}
@@ -518,18 +519,14 @@ int ttd_main(int argc, char *argv[])
SaveToConfig();
SaveToHighScore();
// uninitialize airport state machines
UnInitializeAirports();
/* uninitialize variables that are allocated dynamic */
UnInitializeDynamicVariables();
/* Reset windowing system and free config file */
UnInitializeGame();
/* stop the AI */
AI_Uninitialize();
/* Close all and any open filehandles */
FioCloseAll();
UnInitializeGame();
return 0;
}