diff --git a/src/app/commands/cmd_keyboard_shortcuts.cpp b/src/app/commands/cmd_keyboard_shortcuts.cpp index 8767793c8..6f2da2484 100644 --- a/src/app/commands/cmd_keyboard_shortcuts.cpp +++ b/src/app/commands/cmd_keyboard_shortcuts.cpp @@ -942,9 +942,9 @@ void KeyboardShortcutsCommand::onExecute(Context* context) // Save preferences in widgets that are bound to options automatically { - Message* msg = new Message(kSavePreferencesMessage); - msg->setPropagateToChildren(msg); - window.sendMessage(msg); + Message msg(kSavePreferencesMessage); + msg.setPropagateToChildren(&msg); + window.sendMessage(&msg); } // Save keyboard shortcuts in configuration file diff --git a/src/app/commands/cmd_options.cpp b/src/app/commands/cmd_options.cpp index 61f6cb9c3..2eb6f8fc4 100644 --- a/src/app/commands/cmd_options.cpp +++ b/src/app/commands/cmd_options.cpp @@ -589,9 +589,9 @@ public: void saveConfig() { // Save preferences in widgets that are bound to options automatically { - Message* msg = new Message(kSavePreferencesMessage); - msg->setPropagateToChildren(msg); - sendMessage(msg); + Message msg(kSavePreferencesMessage); + msg.setPropagateToChildren(&msg); + sendMessage(&msg); } // Update language