Javascript's garbage collector destroys popup menus created by menu.popup from api Menu even when they are still active. It can lead to a crash when during destruction phase (when js object is already destroyed but c++ instance of class electron::api::Menu still lives) user makes any interaction with it, like changing focused element.
shell/browser/api/atom_api_menu.cc
int command_id,
                           const base::string16& label,
                           Menu* menu) {
  menu->parent_ = this;
  model_->InsertSubMenuAt(index, command_id, label, menu->model_.get());
}
void Menu::SetIcon(int index, const gfx::Image& image) {
  model_->SetIcon(index, image);
}
void Menu::SetSublabel(int index, const base::string16& sublabel) {
  model_->SetSublabel(index, sublabel);
}
void Menu::SetToolTip(int index, const base::string16& toolTip) {
  model_->SetToolTip(index, toolTip);
}
void Menu::SetRole(int index, const base::string16& role) {
  model_->SetRole(index, role);
}
void Menu::Clear() {
  model_->Clear();
}
int Menu::GetIndexOfCommandId(int command_id) {
  return model_->GetIndexOfCommandId(command_id);
}
int Menu::GetItemCount() const {