- store the master pointer for the subsector lists in sector_t and the seg lists in side_t in FLevelLocals as a TArray instead of relying on the first element's pointer for this.

This simply way bad style.
This commit is contained in:
Christoph Oelckers 2018-12-28 14:24:22 +01:00
commit 326e4d8559
5 changed files with 14 additions and 30 deletions

View file

@ -250,30 +250,22 @@ void P_FreeLevelData ()
if (level.sectors.Size() > 0)
{
delete[] level.sectors[0].e;
if (level.sectors[0].subsectors)
{
delete[] level.sectors[0].subsectors;
level.sectors[0].subsectors = nullptr;
}
}
for (auto &sub : level.subsectors)
{
if (sub.BSP != nullptr) delete sub.BSP;
}
if (level.sides.Size() > 0 && level.sides[0].segs)
{
delete[] level.sides[0].segs;
level.sides[0].segs = nullptr;
}
FBehavior::StaticUnloadModules ();
level.canvasTextureInfo.EmptyList();
level.sections.Clear();
level.segs.Clear();
level.sectors.Clear();
level.linebuffer.Clear();
level.subsectorbuffer.Clear();
level.lines.Clear();
level.sides.Clear();
level.segbuffer.Clear();
level.loadsectors.Clear();
level.loadlines.Clear();
level.loadsides.Clear();