From 01dd42b61fa66cece6e8500e6dc90a9f4784cca1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 18 Jan 2005 16:15:20 +0000 Subject: [PATCH] fixed memory leak in UpdateAttr[Rows][Or][Cols] (patch 1104355) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/grid.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 6f849ff36c..65d60341f8 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -2431,7 +2431,8 @@ void wxGridCellAttrData::UpdateAttrRows( size_t pos, int numRows ) else { // ...or remove the attribute - m_attrs.RemoveAt((size_t)n); + m_attrs[n].attr->DecRef(); + m_attrs.RemoveAt(n); n--; count--; } } @@ -2464,7 +2465,8 @@ void wxGridCellAttrData::UpdateAttrCols( size_t pos, int numCols ) else { // ...or remove the attribute - m_attrs.RemoveAt((size_t)n); + m_attrs[n].attr->DecRef(); + m_attrs.RemoveAt(n); n--; count--; } } @@ -2562,8 +2564,9 @@ void wxGridRowOrColAttrData::UpdateAttrRowsOrCols( size_t pos, int numRowsOrCols rowOrCol += numRowsOrCols; else { - m_rowsOrCols.RemoveAt((size_t)n); - m_attrs.RemoveAt((size_t)n); + m_rowsOrCols.RemoveAt(n); + m_attrs[n]->DecRef(); + m_attrs.RemoveAt(n); n--; count--; } } -- 2.45.2