diff options
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; } |