Browse Source

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.
Humberto Alves 2 years ago
parent
commit
d50b4f3581
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Userland/Libraries/LibGUI/Action.cpp

+ 1 - 1
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);
     }