From f818d2554212e9dba58b6ec3295ddbfdb57a04ee Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 17 Mar 2017 00:31:15 +0100 Subject: [PATCH] - last commit deleted a small piece of code. --- src/p_setup.cpp | 9 +++++++-- src/r_defs.h | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 4485d5763..278b67c7f 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -3436,12 +3436,17 @@ void P_FreeLevelData () level.killed_monsters = level.found_items = level.found_secrets = wminfo.maxfrags = 0; - FBehavior::StaticUnloadModules (); - level.segs.Clear(); if (level.sectors.Size() > 0) { delete[] level.sectors[0].e; } + for (auto &sub : level.subsectors) + { + if (sub.BSP != nullptr) delete sub.BSP; + } + + FBehavior::StaticUnloadModules (); + level.segs.Clear(); level.sectors.Clear(); level.lines.Clear(); level.sides.Clear(); diff --git a/src/r_defs.h b/src/r_defs.h index 18ef9e1d3..f3c28ee84 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -1409,7 +1409,7 @@ struct subsector_t FMiniBSP *BSP; seg_t *firstline; sector_t *render_sector; - uint32_t numlines; + uint32_t numlines; int flags; void BuildPolyBSP(); @@ -1462,7 +1462,6 @@ struct FMiniBSP TArray Verts; }; - // // OTHER TYPES //