mirror of https://github.com/OpenTTD/OpenTTD
(svn r20758) -Fix: when leaving the program, current newgrf config would leak, causing valgrind warnings
parent
a71cc228b2
commit
82949024f1
|
@ -6984,7 +6984,7 @@ static void ResetNewGRFErrors()
|
||||||
* Reset all NewGRF loaded data
|
* Reset all NewGRF loaded data
|
||||||
* TODO
|
* TODO
|
||||||
*/
|
*/
|
||||||
static void ResetNewGRFData()
|
void ResetNewGRFData()
|
||||||
{
|
{
|
||||||
CleanUpStrings();
|
CleanUpStrings();
|
||||||
CleanUpGRFTownNames();
|
CleanUpGRFTownNames();
|
||||||
|
|
|
@ -159,6 +159,7 @@ extern GRFLoadedFeatures _loaded_newgrf_features;
|
||||||
void LoadNewGRFFile(struct GRFConfig *config, uint file_index, GrfLoadingStage stage);
|
void LoadNewGRFFile(struct GRFConfig *config, uint file_index, GrfLoadingStage stage);
|
||||||
void LoadNewGRF(uint load_index, uint file_index);
|
void LoadNewGRF(uint load_index, uint file_index);
|
||||||
void ReloadNewGRFData(); // in saveload/afterload.cpp
|
void ReloadNewGRFData(); // in saveload/afterload.cpp
|
||||||
|
void ResetNewGRFData();
|
||||||
|
|
||||||
void CDECL grfmsg(int severity, const char *str, ...) WARN_FORMAT(2, 3);
|
void CDECL grfmsg(int severity, const char *str, ...) WARN_FORMAT(2, 3);
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
#include "rail_gui.h"
|
#include "rail_gui.h"
|
||||||
#include "core/backup_type.hpp"
|
#include "core/backup_type.hpp"
|
||||||
#include "hotkeys.h"
|
#include "hotkeys.h"
|
||||||
|
#include "newgrf.h"
|
||||||
|
|
||||||
|
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
|
@ -347,6 +348,8 @@ static void ShutdownGame()
|
||||||
free(_config_file);
|
free(_config_file);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ResetNewGRFData();
|
||||||
|
|
||||||
/* Close all and any open filehandles */
|
/* Close all and any open filehandles */
|
||||||
FioCloseAll();
|
FioCloseAll();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue