]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed memory leak in UpdateAttr[Rows][Or][Cols] (patch 1104355)
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 18 Jan 2005 16:15:20 +0000 (16:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 18 Jan 2005 16:15:20 +0000 (16:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index 6f849ff36c828772e5ef8e7c556954e23e92ef8a..65d60341f891cb0e476b1368abaff5b4dd0b5d56 100644 (file)
@@ -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--;
                 }
             }