diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 7dad3f49c..57ff77a7c 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -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(