diff options
author | yexo <yexo@openttd.org> | 2010-02-25 15:54:40 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-02-25 15:54:40 +0000 |
commit | 2c1b7410f3e7f2a50ea3bd8defd687b010a9a910 (patch) | |
tree | 17bc474919d3c4e76be2fe5fad31cfafb92a779f /src/newgrf_config.h | |
parent | 14d28c5e699b8b8e82526e28e16e1d80cd0e7a28 (diff) | |
download | openttd-2c1b7410f3e7f2a50ea3bd8defd687b010a9a910.tar.xz |
(svn r19251) -Codechange: add a contructor to GRFError and use it to allocating errors more uniform.
-Fix: some grf error messages didn't free the previous error messages, creating a memory leak
Diffstat (limited to 'src/newgrf_config.h')
-rw-r--r-- | src/newgrf_config.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/newgrf_config.h b/src/newgrf_config.h index 74e2d54ab..fe3eab37e 100644 --- a/src/newgrf_config.h +++ b/src/newgrf_config.h @@ -13,6 +13,7 @@ #define NEWGRF_CONFIG_H #include "strings_type.h" +#include "core/alloc_type.hpp" /** GRF config bit flags */ enum GCF_Flags { @@ -55,7 +56,10 @@ struct GRFIdentifier { }; /** Information about why GRF had problems during initialisation */ -struct GRFError { +struct GRFError : ZeroedMemoryAllocator { + GRFError(StringID severity, StringID message = 0); + ~GRFError(); + char *custom_message; ///< Custom message (if present) char *data; ///< Additional data for message and custom_message StringID message; ///< Default message |