From a0356796aca055f2209035bd2e80c0dd86f0c0a6 Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Mon, 15 Dec 2025 23:33:13 +0100 Subject: [PATCH] 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. --- src/Mod/Start/Gui/StartView.cpp | 6 ++++++ src/Mod/Start/Gui/StartView.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/Mod/Start/Gui/StartView.cpp b/src/Mod/Start/Gui/StartView.cpp index 65a1ebeaaa..b764fe7630 100644 --- a/src/Mod/Start/Gui/StartView.cpp +++ b/src/Mod/Start/Gui/StartView.cpp @@ -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) { diff --git a/src/Mod/Start/Gui/StartView.h b/src/Mod/Start/Gui/StartView.h index 31397cf5f2..59d63aeda1 100644 --- a/src/Mod/Start/Gui/StartView.h +++ b/src/Mod/Start/Gui/StartView.h @@ -118,6 +118,7 @@ private: QPushButton* _openFirstStart; QCheckBox* _showOnStartupCheckBox; + bool isInitialized = false; }; // namespace StartGui