Fix tree control invalid pointer after drag bug.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2001-08-02 21:37:15 +00:00
parent 208c51418f
commit 4f5fffcc74

View File

@@ -2510,6 +2510,13 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
// erase the highlighting
DrawDropEffect(m_dropTarget);
if ( m_oldSelection )
{
m_oldSelection->SetHilight(TRUE);
RefreshLine(m_oldSelection);
m_oldSelection = (wxGenericTreeItem *)NULL;
}
// generate the drag end event
wxTreeEvent event(wxEVT_COMMAND_TREE_END_DRAG, GetId());
@@ -2522,13 +2529,6 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
m_isDragging = FALSE;
m_dropTarget = (wxGenericTreeItem *)NULL;
if ( m_oldSelection )
{
m_oldSelection->SetHilight(TRUE);
RefreshLine(m_oldSelection);
m_oldSelection = (wxGenericTreeItem *)NULL;
}
ReleaseMouse();
SetCursor(m_oldCursor);