]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix tree control invalid pointer after drag bug.
authorRobert Roebling <robert@roebling.de>
Thu, 2 Aug 2001 21:37:15 +0000 (21:37 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 2 Aug 2001 21:37:15 +0000 (21:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index 2650eac81d69d983d4f94be744644f1b4768e1b9..45a2d924b05e9a1551b6e9abc58c3ff1cdeaf124 100644 (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);