]> git.saurik.com Git - wxWidgets.git/commitdiff
fix attribute memory leak in wxGrid::ShowCellEditControl() (patch 1629949)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 7 Jan 2007 17:09:54 +0000 (17:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 7 Jan 2007 17:09:54 +0000 (17:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/generic/grid.cpp

index 27060de0e4a1dd051bbd803c7e69240fec69b6f0..2d6c52227f4f1bf22dd54cd5dafccc6840cf6c94 100644 (file)
@@ -98,6 +98,7 @@ All:
 - Added wxTreeCtrl::CollapseAll[Children]() and IsEmpty() (Francesco Montorsi)
 - Several RTL-related positioning fixes (Diaa Sami)
 - Fix wxConfig::DeleteGroup() for arguments with trailing slash (David Hart)
 - Added wxTreeCtrl::CollapseAll[Children]() and IsEmpty() (Francesco Montorsi)
 - Several RTL-related positioning fixes (Diaa Sami)
 - Fix wxConfig::DeleteGroup() for arguments with trailing slash (David Hart)
+- Fix memory leak in wxGrid::ShowCellEditControl() (Christian Sturmlechner)
 
 wxMSW:
 
 
 wxMSW:
 
index 22939d4afc505c85c051a6d584651dd174f4fb4d..a1fc2233dbd53dbd6fd6375d8495271dc52213e7 100644 (file)
@@ -8309,7 +8309,8 @@ void wxGrid::ShowCellEditControl()
             // might not cover the entire cell
             wxClientDC dc( m_gridWin );
             PrepareDC( dc );
             // might not cover the entire cell
             wxClientDC dc( m_gridWin );
             PrepareDC( dc );
-            dc.SetBrush(wxBrush(GetCellAttr(row, col)->GetBackgroundColour(), wxSOLID));
+            wxGridCellAttr* attr = GetCellAttr(row, col);
+            dc.SetBrush(wxBrush(attr->GetBackgroundColour(), wxSOLID));
             dc.SetPen(*wxTRANSPARENT_PEN);
             dc.DrawRectangle(rect);
 
             dc.SetPen(*wxTRANSPARENT_PEN);
             dc.DrawRectangle(rect);
 
@@ -8329,7 +8330,6 @@ void wxGrid::ShowCellEditControl()
             if (rect.y > 0)
                 rect.y--;
 
             if (rect.y > 0)
                 rect.y--;
 
-            wxGridCellAttr* attr = GetCellAttr(row, col);
             wxGridCellEditor* editor = attr->GetEditor(this, row, col);
             if ( !editor->IsCreated() )
             {
             wxGridCellEditor* editor = attr->GetEditor(this, row, col);
             if ( !editor->IsCreated() )
             {