(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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user