- fixed memory leak in UDMF loader.

When the extsector allocation was moved, this hadn't been adjusted yet, it still allocated its own buffer which never got freed again.
This commit is contained in:
Christoph Oelckers 2021-03-04 16:55:50 +01:00
parent 357163c60d
commit ecc4d31aa5
1 changed files with 2 additions and 2 deletions

View File

@ -2318,10 +2318,10 @@ public:
// Create the real sectors // Create the real sectors
Level->sectors.Alloc(ParsedSectors.Size()); Level->sectors.Alloc(ParsedSectors.Size());
memcpy(&Level->sectors[0], &ParsedSectors[0], Level->sectors.Size() * sizeof(sector_t)); memcpy(&Level->sectors[0], &ParsedSectors[0], Level->sectors.Size() * sizeof(sector_t));
Level->sectors[0].e = new extsector_t[Level->sectors.Size()]; Level->extsectors.Alloc(Level->sectors.Size());
for(unsigned i = 0; i < Level->sectors.Size(); i++) for(unsigned i = 0; i < Level->sectors.Size(); i++)
{ {
Level->sectors[i].e = &Level->sectors[0].e[i]; Level->sectors[i].e = &Level->extsectors[i];
} }
// Now create the scrollers. // Now create the scrollers.
for (auto &scroll : UDMFScrollers) for (auto &scroll : UDMFScrollers)