reset virtual root to NULL in DeleteAllItems()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2002-12-17 23:22:38 +00:00
parent 968bed8c37
commit bfedf6212c

View File

@ -1659,8 +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()) )
{