Something else i forgot, I am not sure why you are doing
if (action->parent() == m_menu) {
could you clarify? Is it in case it is not the action we created? If you are removing it from the menu you might as well delete it too. Even better, if you change to checking the objectname as i suggested, you'll be "almost really sure" it is the action we created, so there is no need to do this check.
Something else i forgot, I am not sure why you are doing
if (action->parent() == m_menu) {
could you clarify? Is it in case it is not the action we created? If you are removing it from the menu you might as well delete it too. Even better, if you change to checking the objectname as i suggested, you'll be "almost really sure" it is the action we created, so there is no need to do this check.