]> ruin.nu Git - popboot.git/commitdiff
Might be good to have a destructor too
authorMichael Andreen <harv@ruin.nu>
Sun, 8 May 2005 10:34:23 +0000 (10:34 +0000)
committerMichael Andreen <harv@ruin.nu>
Sun, 8 May 2005 10:34:23 +0000 (10:34 +0000)
planner.cpp
planner.h

index cf7801520883ac9e94cf62b958884fc8d95f369b..6d70ae40df2114d32e6cf4f3ab611155e96b6aa6 100644 (file)
@@ -20,6 +20,13 @@ Planner::Planner(std::vector<Action> actions, literals init, literals goal){
        makePlan(finish);
 }
 
+Planner::~Planner(){
+       for (hash_map<string,Node*>::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() << ".. ";
index ce7aef0ffff7a4cabb977797fcce12e72e336892..ab8f4ee27774f4df9e13283a67b1c744619a18f5 100644 (file)
--- a/planner.h
+++ b/planner.h
@@ -39,6 +39,7 @@ size_t operator()(const std::basic_string<CharT, Traits, Alloc>& s) const {
 class Planner {
        public:
                Planner(std::vector<Action> actions, literals init, literals goal);
+               ~Planner();
 
                void execute();