Skip to content

Commit 16df100

Browse files
committed
Freeze view when adding or removing columns
1 parent c134d0f commit 16df100

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clientgui/BOINCListCtrl.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,12 @@ void CBOINCListCtrl::SetListColumnOrder(wxArrayString& orderArray) {
349349
CBOINCBaseView* pView = (CBOINCBaseView*)GetParent();
350350
wxASSERT(wxDynamicCast(pView, CBOINCBaseView));
351351

352+
// Manager will crash if the scroll bar is not at the left-most position on the
353+
// current view if columns are modified.
354+
//
355+
pView->Freeze();
352356
pView->m_iColumnIndexToColumnID.Clear();
353-
for (i=colCount-1; i>=0; --i) {
354-
DeleteColumn(i);
355-
}
356-
357+
DeleteAllColumns();
357358
stdCount = pView->m_aStdColNameOrder->GetCount();
358359

359360
pView->m_iColumnIDToColumnIndex.Clear();
@@ -412,6 +413,7 @@ void CBOINCListCtrl::SetListColumnOrder(wxArrayString& orderArray) {
412413
SetColumnsOrder(aOrder);
413414
}
414415
#endif
416+
pView->Thaw();
415417
}
416418

417419

0 commit comments

Comments
 (0)