From: Michael Andreen Date: Sun, 8 May 2005 10:34:23 +0000 (+0000) Subject: Might be good to have a destructor too X-Git-Url: https://ruin.nu/git/?p=popboot.git;a=commitdiff_plain;h=7b9821d42d980e5788bbc65563973eddd6e4c40d Might be good to have a destructor too --- diff --git a/planner.cpp b/planner.cpp index cf78015..6d70ae4 100644 --- a/planner.cpp +++ b/planner.cpp @@ -20,6 +20,13 @@ Planner::Planner(std::vector actions, literals init, literals goal){ makePlan(finish); } +Planner::~Planner(){ + for (hash_map::iterator node = _addedNodes.begin(); node != _addedNodes.end(); ++node){ + cerr << "Deleting node " << node->second->action().executable() << endl; + delete node->second; + } +} + void Planner::makePlan(Node* node){ cerr << "Fetching preconditions for action: " << node->action().executable() << ".. "; diff --git a/planner.h b/planner.h index ce7aef0..ab8f4ee 100644 --- a/planner.h +++ b/planner.h @@ -39,6 +39,7 @@ size_t operator()(const std::basic_string& s) const { class Planner { public: Planner(std::vector actions, literals init, literals goal); + ~Planner(); void execute();