NodeForIdentifier array works properly

This commit is contained in:
Léa Saviot
2018-06-21 10:11:10 +02:00
parent c6af4bb16c
commit 8ed138fafe
6 changed files with 55 additions and 21 deletions

View File

@@ -1,6 +1,12 @@
#include "tree_node.h"
#include "tree_pool.h"
#include "expression_node.h"
TreePool * TreeNode::Pool() {
static TreePool pool;
return &pool;
}
void TreeNode::release() {
printf("Releasing of %d(%p)\n", m_identifier, this);
m_referenceCounter--;
@@ -19,8 +25,9 @@ void TreeNode::release() {
}
} while (child->identifier() != lastIdentifier);
}
printf("DELETE %d(%p)\n", m_identifier, this);
int identifier = m_identifier;
delete this;
Pool()->freeIdentifier(identifier);
}
}