mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 19:13:55 -07:00
Fix intermittent segfault in VDS sort (#5843)
This commit is contained in:
parent
2189fc0a96
commit
36f9f65798
1 changed files with 6 additions and 2 deletions
|
|
@ -211,14 +211,18 @@ void VisualDeckStorageWidget::createRootFolderWidget()
|
||||||
scrollArea->setWidget(folderWidget); // this automatically destroys the old folderWidget
|
scrollArea->setWidget(folderWidget); // this automatically destroys the old folderWidget
|
||||||
scrollArea->widget()->setMaximumWidth(scrollArea->viewport()->width());
|
scrollArea->widget()->setMaximumWidth(scrollArea->viewport()->width());
|
||||||
scrollArea->widget()->adjustSize();
|
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)
|
void VisualDeckStorageWidget::updateShowFolders(bool enabled)
|
||||||
{
|
{
|
||||||
if (folderWidget) {
|
if (folderWidget) {
|
||||||
folderWidget->updateShowFolders(enabled);
|
folderWidget->updateShowFolders(enabled);
|
||||||
reapplySortAndFilters();
|
QTimer::singleShot(0, this, &VisualDeckStorageWidget::reapplySortAndFilters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue