reset virtual root to NULL in DeleteAllItems()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-12-17 23:22:38 +00:00
parent 45fb821840
commit 21c9fbe5ee

View File

@@ -1659,9 +1659,14 @@ void wxTreeCtrl::DeleteChildren(const wxTreeItemId& item)
void wxTreeCtrl::DeleteAllItems()
{
// delete stored root item.
delete GET_VIRTUAL_ROOT();
// delete the "virtual" root item.
if ( GET_VIRTUAL_ROOT() )
{
delete GET_VIRTUAL_ROOT();
m_pVirtualRoot = NULL;
}
// and all the real items
if ( !TreeView_DeleteAllItems(GetHwnd()) )
{
wxLogLastError(wxT("TreeView_DeleteAllItems"));