diff --git a/src/app/commands/cmd_keyboard_shortcuts.cpp b/src/app/commands/cmd_keyboard_shortcuts.cpp index 53ca073de..076f5e5a9 100644 --- a/src/app/commands/cmd_keyboard_shortcuts.cpp +++ b/src/app/commands/cmd_keyboard_shortcuts.cpp @@ -62,7 +62,7 @@ public: KeyItem(const std::string& text, Key* key, AppMenuItem* menuitem, int level) : ListItem(text) , m_key(key) - , m_keyOrig(key ? new Key(*key): NULL) + , m_keyOrig(key ? new Key(*key): nullptr) , m_menuitem(menuitem) , m_level(level) , m_hotAccel(-1) @@ -73,6 +73,10 @@ public: setBorder(border); } + ~KeyItem() { + delete m_keyOrig; + } + Key* key() { return m_key; } AppMenuItem* menuitem() const { return m_menuitem; }