From bdb8efa08387db94e02a0b63e6abd6948b7ef0e5 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Sat, 7 Jan 2006 18:19:10 +0000 Subject: [PATCH] fixed removing the children in ShellBrowser::InsertSubitems() svn path=/trunk/; revision=20663 --- reactos/subsys/system/explorer/shell/shellbrowser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reactos/subsys/system/explorer/shell/shellbrowser.cpp b/reactos/subsys/system/explorer/shell/shellbrowser.cpp index 28e9588d9f2..0802bce667c 100644 --- a/reactos/subsys/system/explorer/shell/shellbrowser.cpp +++ b/reactos/subsys/system/explorer/shell/shellbrowser.cpp @@ -293,6 +293,7 @@ void ShellBrowser::OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv) int ShellBrowser::InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShellFolder* pParentFolder) { + HTREEITEM hchild, hnext; CONTEXT("ShellBrowser::InsertSubitems()"); WaitCursor wait; @@ -308,7 +309,8 @@ int ShellBrowser::InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShellFold } // remove old children items - for(HTREEITEM hchild,hnext=TreeView_GetChild(_left_hwnd, hParentItem); hchild=hnext; ) { + hnext = hchild = TreeView_GetChild(_left_hwnd, hParentItem); + while((hchild=hnext) != NULL) { hnext = TreeView_GetNextSibling(_left_hwnd, hchild); TreeView_DeleteItem(_left_hwnd, hchild); }