mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-12 23:59:34 -08:00
Fix intermittent segfault in VDS sort (#5843)
This commit is contained in:
@@ -211,14 +211,18 @@ void VisualDeckStorageWidget::createRootFolderWidget()
|
||||
scrollArea->setWidget(folderWidget); // this automatically destroys the old folderWidget
|
||||
scrollArea->widget()->setMaximumWidth(scrollArea->viewport()->width());
|
||||
scrollArea->widget()->adjustSize();
|
||||
reapplySortAndFilters();
|
||||
|
||||
/* We have to schedule a QTimer here so that the sorting logic doesn't try to access widgets that haven't been
|
||||
* processed by the event loop yet. Otherwise, deck sorting will intermittently segfault on some systems.
|
||||
*/
|
||||
QTimer::singleShot(0, this, &VisualDeckStorageWidget::reapplySortAndFilters);
|
||||
}
|
||||
|
||||
void VisualDeckStorageWidget::updateShowFolders(bool enabled)
|
||||
{
|
||||
if (folderWidget) {
|
||||
folderWidget->updateShowFolders(enabled);
|
||||
reapplySortAndFilters();
|
||||
QTimer::singleShot(0, this, &VisualDeckStorageWidget::reapplySortAndFilters);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user