]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed crash introduced by recently applied autowidth patch (patch 1171455)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Mar 2005 18:05:21 +0000 (18:05 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Mar 2005 18:05:21 +0000 (18:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index ee141260eca57634f20232e296685cd7db9a22e0..1d3d6605ec8999001360fd4be91595e21be000fe 100644 (file)
@@ -2263,6 +2263,7 @@ wxListMainWindow::~wxListMainWindow()
 {
     DoDeleteAllItems();
     WX_CLEAR_LIST(wxListHeaderDataList, m_columns);
+    WX_CLEAR_ARRAY(m_aColWidths);
 
     delete m_highlightBrush;
     delete m_highlightUnfocusedBrush;
@@ -4353,7 +4354,7 @@ void wxListMainWindow::DoDeleteAllItems()
         ResetVisibleLinesRange();
         for (size_t i = 0; i < m_aColWidths.GetCount(); i++)
         {
-            delete m_aColWidths.Item(i);
+            m_aColWidths.Item(i)->bNeedsUpdate = true;
         }
     }
 
@@ -4370,6 +4371,7 @@ void wxListMainWindow::DeleteAllItems()
 void wxListMainWindow::DeleteEverything()
 {
     WX_CLEAR_LIST(wxListHeaderDataList, m_columns);
+    WX_CLEAR_ARRAY(m_aColWidths);
 
     DeleteAllItems();
 }