Commit 2951727f authored by Arne Graf's avatar Arne Graf

Univ Dtor

parent f6f34a15
Pipeline #3872 failed with stages
in 8 seconds
......@@ -11,6 +11,30 @@
#include "mesh/RectGrid.h"
UnivFFviaFM::~UnivFFviaFM() {
if (_grid) delete _grid;
size_t speedsize = _speedFieldSelector.size();
for (auto speedPtr : _speedFieldSelector) {
if (speedPtr) delete[] speedPtr;
if (_gridCode) delete[] _gridCode;
if (_subrooms) delete[] _subrooms;
std::map<int, double*>::reverse_iterator delIterCost;
for (delIterCost = _costFieldWithKey.rbegin();
delIterCost != _costFieldWithKey.rend();
++delIterCost) {
delete[] delIterCost->second;
std::map<int, Point*>::reverse_iterator delIterDir;
for (delIterDir = _directionFieldWithKey.rbegin();
delIterDir != _directionFieldWithKey.rend();
++delIterDir) {
delete[] delIterDir->second;
UnivFFviaFM::UnivFFviaFM(Room* r, Building* b, double hx, double wallAvoid, bool useWallAvoid)
: UnivFFviaFM(r, b->GetConfig(), hx, wallAvoid, useWallAvoid) {
_building = b;
......@@ -89,7 +89,7 @@ public:
double spacing, double wallAvoidDist, bool useWallAvoid);
UnivFFviaFM() {};
virtual ~UnivFFviaFM(){};
virtual ~UnivFFviaFM();
void addTarget(const int uid, Line* door, double* costarray = nullptr, Point* gradarray = nullptr);
void addTarget(const int uid, double* costarray = nullptr, Point* gradarray = nullptr);
......@@ -152,6 +152,7 @@ private:
//the following maps are responsible for dealloc the arrays
std::map<int, double*> _costFieldWithKey;
std::map<int, Point*> _directionFieldWithKey;
std::vector<int> _uids;
std::map<int, Line> _doors;
std::vector<int> _toDo;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment