trunk@svn10640 - ProjectTreeSortChildrenRecursive()@ProjectManagerUI.cpp : remove the red part and it is ok
static void ProjectTreeSortChildrenRecursive(cbTreeCtrl* tree, const wxTreeItemId& parent)
{
wxTreeItemIdValue cookie = nullptr;
tree->SortChildren(parent);
wxTreeItemId current = tree->GetFirstChild(parent, cookie);
while (current && tree->ItemHasChildren(current))
{
ProjectTreeSortChildrenRecursive(tree, current);
current = tree->GetNextChild(parent, cookie);
}
}
It breaks the recursion traveling ; current may not have children, but may have brothers :
while (...) loop :
current ( = first child )
|
+------------------------------------+
| |
has children dont have children
| |
v v
- recursion on current's children - missing loop on current's brothers
- loop on current's brothers
You may put the optimization test on 'sterile' nodes inside the while (...) loop. Or code a recurse process differently.