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.
This commit is contained in:
Humberto Alves 2023-02-22 10:37:59 +00:00 committed by Sam Atkins
commit d50b4f3581
Notes: sideshowbarker 2024-07-17 06:40:21 +09:00

View file

@ -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);
}