| 963 | //------------------------------------------------------------------------------ |
| 964 | |
| 965 | void GuiTreeViewCtrl::_destroyChildren( Item* item, Item* parent, bool deleteObjects ) |
| 966 | { |
| 967 | if ( !item || item == parent || !mItems[item->mId-1] ) |
| 968 | return; |
| 969 | |
| 970 | // destroy depth first, then siblings from last to first |
| 971 | if ( item->isParent() && item->mChild ) |
| 972 | _destroyChildren(item->mChild, item, deleteObjects); |
| 973 | if( item->mNext ) |
| 974 | _destroyChildren(item->mNext, parent, deleteObjects); |
| 975 | |
| 976 | // destroy the item |
| 977 | _destroyItem( item, deleteObjects ); |
| 978 | } |
| 979 | |
| 980 | //----------------------------------------------------------------------------- |
| 981 | |