]> git.saurik.com Git - wxWidgets.git/commitdiff
Null m_select_me when this item is deleted
authorJulian Smart <julian@anthemion.co.uk>
Thu, 18 Nov 2004 10:02:56 +0000 (10:02 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 18 Nov 2004 10:02:56 +0000 (10:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30601 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index 04c73b4e20829e76a332ad233105b734182bea5b..3296a9809449a0f5c61a7d12167c78cc6c9e72ff 100644 (file)
@@ -536,6 +536,8 @@ void wxGenericTreeItem::DeleteChildren(wxGenericTreeCtrl *tree)
             tree->SendDeleteEvent(child);
 
         child->DeleteChildren(tree);
+        if (child == tree->m_select_me)
+            tree->m_select_me = NULL;
         delete child;
     }
 
@@ -1568,6 +1570,10 @@ void wxGenericTreeCtrl::Delete(const wxTreeItemId& itemId)
     // and delete all of its children and the item itself now
     item->DeleteChildren(this);
     SendDeleteEvent(item);
+
+    if (item == m_select_me)
+        m_select_me = NULL;
+    
     delete item;
 }