コード例 #1
0
ファイル: openttd.cpp プロジェクト: IchiroWang/OpenTTD
/**
 * Unitializes drivers, frees allocated memory, cleans pools, ...
 * Generally, prepares the game for shutting down
 */
static void ShutdownGame()
{
	IConsoleFree();

	if (_network_available) NetworkShutDown(); // Shut down the network and close any open connections

	DriverFactoryBase::ShutdownDrivers();

	UnInitWindowSystem();

	/* stop the scripts */
	AI::Uninitialize(false);
	Game::Uninitialize(false);

	/* Uninitialize variables that are allocated dynamically */
	GamelogReset();

#ifdef ENABLE_NETWORK
	free(_config_file);
#endif

	LinkGraphSchedule::Clear();
	PoolBase::Clean(PT_ALL);

	/* No NewGRFs were loaded when it was still bootstrapping. */
	if (_game_mode != GM_BOOTSTRAP) ResetNewGRFData();

	/* Close all and any open filehandles */
	FioCloseAll();

	UninitFreeType();
}
コード例 #2
0
ファイル: openttd.cpp プロジェクト: dolly22/openttd-sai
/**
 * Unitializes drivers, frees allocated memory, cleans pools, ...
 * Generally, prepares the game for shutting down
 */
static void ShutdownGame()
{
	IConsoleFree();

	if (_network_available) NetworkShutDown(); // Shut down the network and close any open connections

	DriverFactoryBase::ShutdownDrivers();

	UnInitWindowSystem();

	/* stop the AI */
	AI::Uninitialize(false);

	/* Uninitialize variables that are allocated dynamically */
	GamelogReset();
	_town_pool.CleanPool();
	_industry_pool.CleanPool();
	_station_pool.CleanPool();
	_roadstop_pool.CleanPool();
	_vehicle_pool.CleanPool();
	_sign_pool.CleanPool();
	_order_pool.CleanPool();
	_group_pool.CleanPool();
	_cargopacket_pool.CleanPool();
	_engine_pool.CleanPool();
	_company_pool.CleanPool();

#ifdef ENABLE_NETWORK
	free(_config_file);
#endif

	ResetNewGRFData();

	/* Close all and any open filehandles */
	FioCloseAll();
}