From d50b4f358196ad08aa9f1e333fa760f069e54759 Mon Sep 17 00:00:00 2001 From: Humberto Alves Date: Wed, 22 Feb 2023 10:37:59 +0000 Subject: [PATCH] LibGUI: Fix Action destructor to unregister itself correctly Changed the Action destructor to fix an issue where global scoped actions without shortcuts were not being properly unregistered from the application. Previously, this could cause crashes when attempting to open the command palette. --- Userland/Libraries/LibGUI/Action.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/Action.cpp b/Userland/Libraries/LibGUI/Action.cpp index 04a34d1a1b..7c6863b519 100644 --- a/Userland/Libraries/LibGUI/Action.cpp +++ b/Userland/Libraries/LibGUI/Action.cpp @@ -124,7 +124,7 @@ Action::Action(DeprecatedString text, Shortcut const& shortcut, Shortcut const& Action::~Action() { - if (m_shortcut.is_valid() && m_scope == ShortcutScope::ApplicationGlobal) { + if (m_scope == ShortcutScope::ApplicationGlobal) { if (auto* app = Application::the()) app->unregister_global_shortcut_action({}, *this); }