Mercurial > hg > openttd
changeset 5351:6419e75ebeec draft
(svn r7522) -Codechange: Have CopyGRFConfigList clear the destination list before assigning
values to it. This cuts down on memleaks which could exist when the function was
not used carefully.
author | Darkvater <Darkvater@openttd.org> |
---|---|
date | Thu, 21 Dec 2006 10:09:43 +0000 |
parents | 2423262a9f8c |
children | 396149d61d0d |
files | newgrf_config.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/newgrf_config.c +++ b/newgrf_config.c @@ -115,6 +115,8 @@ { GRFConfig *c; + /* Clear destination as it will be overwritten */ + ClearGRFConfigList(dst); for (; src != NULL; src = src->next) { c = calloc(1, sizeof(*c)); *c = *src; @@ -135,8 +137,6 @@ { GRFConfig **c = &_grfconfig; - ClearGRFConfigList(c); - if (defaults) c = CopyGRFConfigList(c, _grfconfig_newgame); CopyGRFConfigList(c, _grfconfig_static); }