1
0
Fork 0

Cleanup: Remove redundant NewGRF clean up functions.

These functions no longer clean up manually managed memory, they simply clear GRFFile's vectors of unique_ptrs. This will happen anyway when the GRFFile is deleted.
pull/13927/head
Peter Nelson 2025-03-30 21:25:54 +01:00
parent 99c6e85356
commit 36e6253df9
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 0 additions and 55 deletions

View File

@ -370,55 +370,6 @@ void GRFUnsafe(ByteReader &)
_cur.skip_sprites = -1; _cur.skip_sprites = -1;
} }
/** Reset and clear all NewGRF stations */
static void ResetCustomStations()
{
for (GRFFile * const file : _grf_files) {
file->stations.clear();
}
}
/** Reset and clear all NewGRF houses */
static void ResetCustomHouses()
{
for (GRFFile * const file : _grf_files) {
file->housespec.clear();
}
}
/** Reset and clear all NewGRF airports */
static void ResetCustomAirports()
{
for (GRFFile * const file : _grf_files) {
file->airportspec.clear();
file->airtspec.clear();
}
}
/** Reset and clear all NewGRF industries */
static void ResetCustomIndustries()
{
for (GRFFile * const file : _grf_files) {
file->industryspec.clear();
file->indtspec.clear();
}
}
/** Reset and clear all NewObjects */
static void ResetCustomObjects()
{
for (GRFFile * const file : _grf_files) {
file->objectspec.clear();
}
}
static void ResetCustomRoadStops()
{
for (auto file : _grf_files) {
file->roadstops.clear();
}
}
/** Reset and clear all NewGRFs */ /** Reset and clear all NewGRFs */
static void ResetNewGRF() static void ResetNewGRF()
{ {
@ -484,31 +435,25 @@ void ResetNewGRFData()
ResetCurrencies(); ResetCurrencies();
/* Reset the house array */ /* Reset the house array */
ResetCustomHouses();
ResetHouses(); ResetHouses();
/* Reset the industries structures*/ /* Reset the industries structures*/
ResetCustomIndustries();
ResetIndustries(); ResetIndustries();
/* Reset the objects. */ /* Reset the objects. */
ObjectClass::Reset(); ObjectClass::Reset();
ResetCustomObjects();
ResetObjects(); ResetObjects();
/* Reset station classes */ /* Reset station classes */
StationClass::Reset(); StationClass::Reset();
ResetCustomStations();
/* Reset airport-related structures */ /* Reset airport-related structures */
AirportClass::Reset(); AirportClass::Reset();
ResetCustomAirports();
AirportSpec::ResetAirports(); AirportSpec::ResetAirports();
AirportTileSpec::ResetAirportTiles(); AirportTileSpec::ResetAirportTiles();
/* Reset road stop classes */ /* Reset road stop classes */
RoadStopClass::Reset(); RoadStopClass::Reset();
ResetCustomRoadStops();
/* Reset canal sprite groups and flags */ /* Reset canal sprite groups and flags */
_water_feature.fill({}); _water_feature.fill({});