From: Vadim Zeitlin Date: Sun, 27 Mar 2005 18:05:21 +0000 (+0000) Subject: fixed crash introduced by recently applied autowidth patch (patch 1171455) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8d36b2167df7e86ecfc58d148eaf6abe0a5b7971 fixed crash introduced by recently applied autowidth patch (patch 1171455) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index ee141260ec..1d3d6605ec 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -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(); }