diff options
author | yexo <yexo@openttd.org> | 2010-02-25 20:06:11 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-02-25 20:06:11 +0000 |
commit | 7ff55502f04f9f75b01879ea04518c14d4706046 (patch) | |
tree | f48f911cf9861a0053bd35b92bf1e0ece0a5bf58 /src/gfxinit.cpp | |
parent | a9c8dbc0a0e1f1fc4434cf0c83ff658ab8d9e3d9 (diff) | |
download | openttd-7ff55502f04f9f75b01879ea04518c14d4706046.tar.xz |
(svn r19256) -Codechange: use a constructor/destructor for GRFConfig to make sure all members are properly initialized
Diffstat (limited to 'src/gfxinit.cpp')
-rw-r--r-- | src/gfxinit.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index f2678ae09..6ba87eee1 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -178,8 +178,7 @@ static void LoadSpriteTables() * so we have to manually add it, and then remove it later. */ GRFConfig *top = _grfconfig; - GRFConfig *master = CallocT<GRFConfig>(1); - master->filename = strdup(used_set->files[GFT_EXTRA].filename); + GRFConfig *master = new GRFConfig(used_set->files[GFT_EXTRA].filename); FillGRFDetails(master, false); master->windows_paletted = (used_set->palette == PAL_WINDOWS); ClrBit(master->flags, GCF_INIT_ONLY); @@ -189,7 +188,7 @@ static void LoadSpriteTables() LoadNewGRF(SPR_NEWGRFS_BASE, i); /* Free and remove the top element. */ - ClearGRFConfig(&master); + delete master; _grfconfig = top; } |