2010-03-09 01:42:23 +00:00
|
|
|
#include "memTreeComponent.h"
|
2010-03-17 21:51:26 +00:00
|
|
|
#include "datatuple.h"
|
|
|
|
|
2011-06-09 00:27:57 +00:00
|
|
|
void memTreeComponent::tearDownTree(rbtree_ptr_t tree) {
|
|
|
|
datatuple * t = 0;
|
2010-03-09 01:42:23 +00:00
|
|
|
typename rbtree_t::iterator old;
|
|
|
|
for(typename rbtree_t::iterator delitr = tree->begin();
|
|
|
|
delitr != tree->end();
|
|
|
|
delitr++) {
|
|
|
|
if(t) {
|
|
|
|
tree->erase(old);
|
2011-06-09 00:27:57 +00:00
|
|
|
datatuple::freetuple(t);
|
2010-03-09 01:42:23 +00:00
|
|
|
t = 0;
|
|
|
|
}
|
|
|
|
t = *delitr;
|
|
|
|
old = delitr;
|
|
|
|
}
|
|
|
|
if(t) {
|
|
|
|
tree->erase(old);
|
2011-06-09 00:27:57 +00:00
|
|
|
datatuple::freetuple(t);
|
2010-03-09 01:42:23 +00:00
|
|
|
}
|
|
|
|
delete tree;
|
|
|
|
}
|