git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18314
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxTreeCtrl::DeleteAllItems()
{
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()) )
{
if ( !TreeView_DeleteAllItems(GetHwnd()) )
{