diff -r 8b225c2935e7 -r 22fdc00894aa gui/new_map_win.cc --- a/gui/new_map_win.cc Mon Jan 09 11:55:47 2006 +0000 +++ b/gui/new_map_win.cc Mon Jan 09 12:41:06 2006 +0000 @@ -159,8 +159,6 @@ //display it //gdc.changeEdgeText(mapname); - - //delete emptr; } else //!edge.get_active() { @@ -240,8 +238,6 @@ //display it //gdc.changeNodeText(mapname); - - //delete emptr; } if(!abortion) { @@ -374,11 +370,26 @@ std::string polishform=postOrder(root); + deleteTree(root); + return polishform; } return ""; } +void NewMapWin::deleteTree(NewMapWin::tree_node * node) +{ + if(node->left_child!=NULL) + { + deleteTree(node->left_child); + } + if(node->right_child!=NULL) + { + deleteTree(node->right_child); + } + delete node; +} + NewMapWin::tree_node * NewMapWin::weightedString2Tree(std::string to_tree, std::vector & p, int offset) { unsigned int min=p[offset];