From 16df10060abf2f3a65875ed7b71d2070a6d22960 Mon Sep 17 00:00:00 2001 From: Vulpine05 Date: Mon, 5 Sep 2022 08:49:03 -0500 Subject: [PATCH] Freeze view when adding or removing columns --- clientgui/BOINCListCtrl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/clientgui/BOINCListCtrl.cpp b/clientgui/BOINCListCtrl.cpp index fd640072b72..a2dcc7ad103 100644 --- a/clientgui/BOINCListCtrl.cpp +++ b/clientgui/BOINCListCtrl.cpp @@ -349,11 +349,12 @@ void CBOINCListCtrl::SetListColumnOrder(wxArrayString& orderArray) { CBOINCBaseView* pView = (CBOINCBaseView*)GetParent(); wxASSERT(wxDynamicCast(pView, CBOINCBaseView)); + // Manager will crash if the scroll bar is not at the left-most position on the + // current view if columns are modified. + // + pView->Freeze(); pView->m_iColumnIndexToColumnID.Clear(); - for (i=colCount-1; i>=0; --i) { - DeleteColumn(i); - } - + DeleteAllColumns(); stdCount = pView->m_aStdColNameOrder->GetCount(); pView->m_iColumnIDToColumnIndex.Clear(); @@ -412,6 +413,7 @@ void CBOINCListCtrl::SetListColumnOrder(wxArrayString& orderArray) { SetColumnsOrder(aOrder); } #endif + pView->Thaw(); }