]> git.saurik.com Git - wxWidgets.git/commitdiff
reset virtual root to NULL in DeleteAllItems()
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 17 Dec 2002 23:22:38 +0000 (23:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 17 Dec 2002 23:22:38 +0000 (23:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/treectrl.cpp

index 66698a85374f7275bc7661d0ce9c6325d270b0be..a6fa885c52ed64f935e5fd40fcda7cea389772bf 100644 (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()) )
     {