Destroy array of costs after we're done with them
This commit is contained in:
@@ -102,7 +102,6 @@ namespace StepParity {
|
|||||||
int whereTheFeetAre[NUM_Foot]; // the inverse of columns
|
int whereTheFeetAre[NUM_Foot]; // the inverse of columns
|
||||||
bool didTheFootMove[NUM_Foot]; // the inverse of movedFeet
|
bool didTheFootMove[NUM_Foot]; // the inverse of movedFeet
|
||||||
bool isTheFootHolding[NUM_Foot]; //inverse of holdFeet
|
bool isTheFootHolding[NUM_Foot]; //inverse of holdFeet
|
||||||
|
|
||||||
// These hashes are used in operator<() to speed up the comparison of the vectors.
|
// These hashes are used in operator<() to speed up the comparison of the vectors.
|
||||||
// Their values are computed by calculateHashes(), which is used in StepParityGenerator::buildStateGraph().
|
// Their values are computed by calculateHashes(), which is used in StepParityGenerator::buildStateGraph().
|
||||||
int columnsHash = 0;
|
int columnsHash = 0;
|
||||||
@@ -242,6 +241,15 @@ namespace StepParity {
|
|||||||
State state;
|
State state;
|
||||||
|
|
||||||
std::unordered_map<StepParityNode *, float*> neighbors; // Connections to, and the cost of moving to, the connected nodes
|
std::unordered_map<StepParityNode *, float*> neighbors; // Connections to, and the cost of moving to, the connected nodes
|
||||||
|
|
||||||
|
~StepParityNode()
|
||||||
|
{
|
||||||
|
for(auto neighbor: neighbors)
|
||||||
|
{
|
||||||
|
delete[] neighbor.second;
|
||||||
|
}
|
||||||
|
neighbors.clear();
|
||||||
|
}
|
||||||
StepParityNode(const State &_state)
|
StepParityNode(const State &_state)
|
||||||
{
|
{
|
||||||
state = _state;
|
state = _state;
|
||||||
|
|||||||
Reference in New Issue
Block a user