Skip to content

Commit

Permalink
Remove QMenu instance after being shown
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy Vlasov committed Nov 29, 2018
1 parent 21f1388 commit 4bd6a28
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules/react-native-desktop-menu/desktop/desktopmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void DesktopMenuPrivate::createMenu(const QStringList& items, double callback) {
QObject::connect(menu, &QMenu::triggered, [=](QAction* action) {
bridge->invokePromiseCallback(callback, QVariantList{action->text()});
});
QObject::connect(menu, &QMenu::triggered, menu, &QMenu::deleteLater);
menu->popup(QCursor::pos());
}

Expand Down

0 comments on commit 4bd6a28

Please sign in to comment.