From b6b862cad7b03b7b200f6cb8688d57cfcf0f648d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Sun, 9 Aug 2026 03:33:42 +0200 Subject: [PATCH] Guard tutorial step target widgets with QPointer --- .../interface/widgets/general/tutorial/tutorial_controller.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/interface/widgets/general/tutorial/tutorial_controller.h b/cockatrice/src/interface/widgets/general/tutorial/tutorial_controller.h index 9b9889dd3..f85ac37fd 100644 --- a/cockatrice/src/interface/widgets/general/tutorial/tutorial_controller.h +++ b/cockatrice/src/interface/widgets/general/tutorial/tutorial_controller.h @@ -5,6 +5,7 @@ #include #include +#include #include enum class ValidationTiming @@ -19,7 +20,8 @@ class TutorialController; struct TutorialStep { - QWidget *targetWidget = nullptr; + // QPointer so a destroyed widget is detected instead of dereferencing a dangling pointer. + QPointer targetWidget; QString text; std::function onEnter = nullptr; std::function onExit = nullptr;