mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 00:00:44 +01:00
Clean and correct TreeNode
This commit is contained in:
@@ -2,20 +2,12 @@
|
||||
#include "expression_node.h"
|
||||
|
||||
void TreeNode::release() {
|
||||
printf("releasing of %d(%p)\n", m_identifier, this);
|
||||
printf("Releasing of %d(%p)\n", m_identifier, this);
|
||||
m_referenceCounter--;
|
||||
if (m_referenceCounter == 0) {
|
||||
#if 0
|
||||
for (TreeNode * child : directChildren()) {
|
||||
// BUG FIXME
|
||||
// Here, if we end up delete-ing the node
|
||||
// then the 'next child' is wrong...
|
||||
child->release();
|
||||
}
|
||||
#endif
|
||||
if (numberOfChildren() != 0) {
|
||||
int lastIdentifier = lastDescendant()->identifier();
|
||||
TreeNode * child = this;
|
||||
TreeNode * child = next();
|
||||
do {
|
||||
bool childWillBeDeleted = (child->m_referenceCounter == 1);
|
||||
child->release();
|
||||
|
||||
Reference in New Issue
Block a user