Gui: Fix segfault in Safe Mode

This fixes segfault that was caused by changing settings in
FirstStartWidget that triggered change event on not fully intialized
StartView.

It is quick and dirty fix that just disables handling of the event
causing segfault until widget is fully ready. The correct solution would
be to remove the logic that changes settings from the widget (as it
should not be there) and instad move it to another place in pipeline.
This would be however much more work and segfault should be fixed ASAP.
This commit is contained in:
Kacper Donat
2025-12-15 23:33:13 +01:00
committed by Chris Hennes
parent d116764dc3
commit a0356796ac
2 changed files with 7 additions and 0 deletions

View File

@@ -195,6 +195,8 @@ StartView::StartView(QWidget* parent)
}
});
isInitialized = true;
retranslateUi();
}
@@ -438,6 +440,10 @@ void StartView::firstStartWidgetDismissed()
void StartView::changeEvent(QEvent* event)
{
if (!isInitialized) {
return;
}
_openFirstStart->setEnabled(true);
Gui::Document* doc = Gui::Application::Instance->activeDocument();
if (doc) {

View File

@@ -118,6 +118,7 @@ private:
QPushButton* _openFirstStart;
QCheckBox* _showOnStartupCheckBox;
bool isInitialized = false;
}; // namespace StartGui