]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
fix assert failure if NULL size pointer was passed to Request() (as happened in the...
[wxWidgets.git] / src / generic / grid.cpp
index a5978ae75d7a6108e334f5c6d40bbbe07992da11..491b2c21bd7526a5065ebaa2b9c7fc4f51c861c9 100644 (file)
@@ -4520,6 +4520,9 @@ bool wxGrid::Create(wxWindow *parent, wxWindowID id,
 
 wxGrid::~wxGrid()
 {
+    if ( m_winCapture )
+        m_winCapture->ReleaseMouse();
+
     // Ensure that the editor control is destroyed before the grid is,
     // otherwise we crash later when the editor tries to do something with the
     // half destroyed grid
@@ -6168,8 +6171,7 @@ void wxGrid::ChangeCursorMode(CursorMode mode,
 
     if ( m_winCapture )
     {
-        if (m_winCapture->HasCapture())
-            m_winCapture->ReleaseMouse();
+        m_winCapture->ReleaseMouse();
         m_winCapture = NULL;
     }
 
@@ -6396,8 +6398,7 @@ wxGrid::DoGridCellLeftUp(wxMouseEvent& event, const wxGridCellCoords& coords)
     {
         if (m_winCapture)
         {
-            if (m_winCapture->HasCapture())
-                m_winCapture->ReleaseMouse();
+            m_winCapture->ReleaseMouse();
             m_winCapture = NULL;
         }