Keep last menu in memory

Might do something about #1790
This commit is contained in:
Rasmus Karlsson 2020-07-18 17:51:31 +02:00
parent ba06b10135
commit d25dee10b2

View file

@ -1648,10 +1648,15 @@ void ChannelView::addContextMenuItems(
const auto &creator = hoveredElement->getCreator();
auto creatorFlags = creator.getFlags();
static QMenu *previousMenu = nullptr;
if (previousMenu != nullptr)
{
previousMenu->deleteLater();
previousMenu = nullptr;
}
auto menu = new QMenu;
connect(menu, &QMenu::aboutToHide, [menu] {
menu->deleteLater(); //
});
previousMenu = menu;
// Emote actions
if (creatorFlags.hasAny(