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:
@@ -1659,9 +1659,14 @@ void wxTreeCtrl::DeleteChildren(const wxTreeItemId& item)
|
|||||||
|
|
||||||
void wxTreeCtrl::DeleteAllItems()
|
void wxTreeCtrl::DeleteAllItems()
|
||||||
{
|
{
|
||||||
// delete stored root item.
|
// delete the "virtual" root item.
|
||||||
delete GET_VIRTUAL_ROOT();
|
if ( GET_VIRTUAL_ROOT() )
|
||||||
|
{
|
||||||
|
delete GET_VIRTUAL_ROOT();
|
||||||
|
m_pVirtualRoot = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// and all the real items
|
||||||
if ( !TreeView_DeleteAllItems(GetHwnd()) )
|
if ( !TreeView_DeleteAllItems(GetHwnd()) )
|
||||||
{
|
{
|
||||||
wxLogLastError(wxT("TreeView_DeleteAllItems"));
|
wxLogLastError(wxT("TreeView_DeleteAllItems"));
|
||||||
|
Reference in New Issue
Block a user