forked from mirror/OpenTTD
(svn r8820) -Codechange (r8807, r8806): Remove the unneeded calloc/free allocation of GRFConfig and turn it into a simple variable (it's supposed to be data-only). Thanks Tron.
This commit is contained in:
@@ -465,12 +465,13 @@ static void Save_NGRF(void)
|
||||
|
||||
static void Load_NGRF(void)
|
||||
{
|
||||
GRFConfig *c = CallocT<GRFConfig>(1);
|
||||
GRFConfig c;
|
||||
memset(&c, 0, sizeof(GRFConfig));
|
||||
|
||||
while (SlIterateArray() != -1) {
|
||||
SlObject(c, _grfconfig_desc);
|
||||
AppendToGRFConfigList(&_grfconfig, c);
|
||||
SlObject(&c, _grfconfig_desc);
|
||||
AppendToGRFConfigList(&_grfconfig, &c);
|
||||
}
|
||||
free(c);
|
||||
|
||||
/* Append static NewGRF configuration */
|
||||
AppendStaticGRFConfigs(&_grfconfig);
|
||||
|
Reference in New Issue
Block a user